-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml.html
More file actions
107 lines (92 loc) · 2.52 KB
/
xml.html
File metadata and controls
107 lines (92 loc) · 2.52 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>XML Parser</title>
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<style>
textarea {
width: 100%;
height: 200px;
}
textarea,
input {
font-family: monospace;
}
#sax-output,
#dom-output,
#xpath-output {
font-family: monospace;
vertical-align: top;
width: 33%;
}
#sax-output div {
display: flex;
}
#sax-output div span {
flex: 1;
}
#dom-output {
white-space: pre;
}
#dom-output .selection {
background-color: #9b4dca;
color: #fff;
}
.error {
color: red;
font-weight: normal;
}
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QK0KCHXW3F"></script>
<script>window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-QK0KCHXW3F');</script>
</head>
<body>
<h1>XML Parser</h1>
<h2>Input</h2>
<fieldset>
<label for="xml-input">XML</label>
<textarea id="xml-input"><?xml version="1.0"?>
<bookshelf>
<book>
<title lang="en" pages="328" year="1949">Nineteen Eighty-Four</title>
<author>George Orwell</author>
</book>
<book>
<title lang="en" pages="234" year="1951">The Catcher in the Rye</title>
<author>J. D. Salinger</author>
</book>
<book>
<title lang="de" year="2005">
Die Vermessung der Welt
</title>
<author>Daniel Kehlmann</author><publisher>Rowohlt</publisher>
</book>
</bookshelf></textarea>
<label for="xpath-input">XPath <span id="xpath-error" class="error"></span></label>
<input id="xpath-input" value="//book[title/@lang="en"]/author/text()">
<input id="dom-pretty" type="checkbox">
<label for="dom-pretty" class="label-inline">Pretty-print DOM</label>
</fieldset>
<h2>Output</h2>
<table>
<thead>
<tr>
<th>XML Events (SAX)</th>
<th>XML DOM</th>
<th>XPath</th>
</tr>
</thead>
<tbody>
<tr>
<td id="sax-output"></td>
<td id="dom-output"></td>
<td id="xpath-output"></td>
</tr>
</tbody>
</table>
<script src="xml.dart.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QK0KCHXW3F"></script>
<script>window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-QK0KCHXW3F');</script>
</body>
</html>