1. Martin Czygan
  2. mdma-slides


mdma-slides / deck.js / extensions / codemirror / mode / xmlpure / index.html

<!doctype html>
    <title>CodeMirror 2: Pure XML mode</title>
    <link rel="stylesheet" href="../../lib/codemirror.css">
    <script src="../../lib/codemirror.js"></script>
    <script src="xmlpure.js"></script>
    <link rel="stylesheet" href="../../theme/default.css">
    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
    <link rel="stylesheet" href="../../css/docs.css">
    <h1>CodeMirror 2: XML mode</h1>
    <form><textarea id="code" name="code">
&lt;?xml version="1.0" encoding="UTF-8" standalone="no" ?&gt;

&lt;!-- This is the pure XML mode,
and we're inside a comment! --&gt;

    &lt;book id="bk01"&gt;
      &lt;title&gt;Lord of Light&lt;/title&gt;
      &lt;author&gt;Roger Zelazny&lt;/author&gt;
      &lt;description&gt;&lt;![CDATA[This is a great book, really!!]]&gt;&lt;/description&gt;
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: {name: "xmlpure"}});

    <p>This is my XML parser, based on the original:</p> 
    	<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>&lt;?xml version="1.0" encoding="utf-8" standalone="no" ?&gt;</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> 
    <p>What's missing:</p> 
    	<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> 
    <p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/xml</code>.</p> 
    <p><b>@author</b>: Dror BG (<i>deebug dot dev at gmail dot 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>