-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
91 lines (85 loc) · 2.03 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html>
<head>
<title>XMLtoJSON example</title>
<script src='XMLtoJSON.js'></script>
<style>
* {
font-family: sans-serif;
}
body {
padding:0px 10px;
}
table {
width:100%;
height:800px;
margin-top: 20px;
}
td {
text-align: center;
padding: 0px 10px 0px 0px;
}
input {
font-size: .8em;
margin:0px;
}
textarea {
width:100%;
height:100%;
font-family: monospace;
font-size: 1.2em;
}
</style>
<script type="text/javascript">
function getThatJson () {
var xml_in = '' + document.getElementById('xml').value;
try{
var result = XMLtoJSON(xml_in);
result = JSON.stringify(result, undefined, ' ');
result = result.replace(/\n/g, '\r\n');
document.getElementById('json').value = result;
} catch (error){
console.error(error.message);
}
}
</script>
</head>
<body>
<h1>XMLtoJSON</h1>
Throw some XML in the left box and hit   <input type='button' value='GO' onclick='getThatJson()'>
<br>
<table>
<tr><td>
<textarea id="xml">
<?xml version="1.0" standalone="yes"?>
<svg width="400px" height="300px" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<font id="Font1" horiz-adv-x="1000">
<font-face font-family="Super Sans" font-weight="bold" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500">
<font-face-src>
<font-face-name name="Super Sans Bold"/>
</font-face-src>
</font-face>
<missing-glyph>
<path d="M0,0h200v200h-200z"/>
</missing-glyph>
<glyph unicode="!" horiz-adv-x="300">
<!-- Outline of exclam. pt. glyph -->
</glyph>
<glyph unicode="@">
<!-- Outline of @ glyph -->
</glyph>
<!-- more glyphs -->
</font>
</defs>
<text x="100" y="100" style="font-family: 'Super Sans', Helvetica, sans-serif; font-weight: bold; font-style: normal">
Text using embedded font
</text>
</svg>
</textarea>
</td><td>
<textarea id='json'></textarea>
</td></tr>
</table>
</body>
</html>