blob: 721834aca190ff689d62c0b1fe549036cb3265d0 (
plain)
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
|
<!doctype html>
<html>
<head>
<title>CodeMirror: Pure XML mode</title>
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="xmlpure.js"></script>
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<link rel="stylesheet" href="../../doc/docs.css">
</head>
<body>
<h1>CodeMirror: XML mode</h1>
<form><textarea id="code" name="code">
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- This is the pure XML mode,
and we're inside a comment! -->
<catalog>
<books>
<book id="bk01">
<title>Lord of Light</title>
<author>Roger Zelazny</author>
<year>1967</year>
<description><![CDATA[This is a great book, really!!]]></description>
</book>
</books>
</catalog>
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: {name: "xmlpure"}});
</script>
<p>This is my XML parser, based on the original:</p>
<ul>
<li>No html mode - this is pure xml</li>
<li>Illegal attributes and element names are errors</li>
<li>Attributes must have a value</li>
<li>XML declaration supported (e.g.: <b><?xml version="1.0" encoding="utf-8" standalone="no" ?></b>)</li>
<li>CDATA and comment blocks are not indented (except for their start-tag)</li>
<li>Better handling of errors per line with the state object - provides good infrastructure for extending it</li>
</ul>
<p>What's missing:</p>
<ul>
<li>Make sure only a single root element exists at the document level</li>
<li>Multi-line attributes should NOT indent</li>
<li>Start tags are not painted red when they have no matching end tags (is this really wrong?)</li>
</ul>
<p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/xml</code>.</p>
<p><b>@author</b>: Dror BG (<i>deebug.dev[at]gmail.com</i>)<br/>
<p><b>@date</b>: August, 2011<br/>
<p><b>@github</b>: <a href='https://github.com/deebugger/CodeMirror2' target='blank'>https://github.com/deebugger/CodeMirror2</a></p>
<p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/xml</code>.</p>
</body>
</html>
|