PageRenderTime 86ms CodeModel.GetById 81ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/users-guide/xml-primer.html

#
HTML | 33 lines | 30 code | 3 blank | 0 comment | 0 complexity | 7d4930a1bff92c01f1957dfa52985a0a MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>An XML Primer</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="writing-modes.html" title="Chapter 10. Mode Definition Syntax"><link rel="prev" href="writing-modes.html" title="Chapter 10. Mode Definition Syntax"><link rel="next" href="mode-preamble.html" title="The Preamble and MODE tag"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">An XML Primer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="writing-modes.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Mode Definition Syntax</th><td width="20%" align="right"> <a accesskey="n" href="mode-preamble.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="xml-primer"></a>An XML Primer</h2></div></div></div><p>A very simple XML file (which also happens to be an edit mode)
 2        looks like so:</p><pre class="programlisting">&lt;?xml version="1.0"?&gt;
 3
 4&lt;!DOCTYPE MODE SYSTEM "xmode.dtd"&gt;
 5
 6&lt;MODE&gt;
 7    &lt;PROPS&gt;
 8        &lt;PROPERTY NAME="commentStart" VALUE="/*" /&gt;
 9        &lt;PROPERTY NAME="commentEnd" VALUE="*/" /&gt;
10    &lt;/PROPS&gt;
11
12    &lt;RULES&gt;
13        &lt;SPAN TYPE="COMMENT1"&gt;
14            &lt;BEGIN&gt;/*&lt;/BEGIN&gt;
15            &lt;END&gt;*/&lt;/END&gt;
16        &lt;/SPAN&gt;
17    &lt;/RULES&gt;
18&lt;/MODE&gt;</pre><p>Note that each opening tag must have a corresponding closing tag.
19        If there is nothing between the opening and closing tags, for example
20        <code class="literal">&lt;TAG&gt;&lt;/TAG&gt;</code>, the shorthand notation
21        <code class="literal">&lt;TAG /&gt;</code> may be used. An example of this
22        shorthand can be seen in the <code class="literal">&lt;PROPERTY&gt;</code> tags
23        above.</p><p>XML is case sensitive. <code class="literal">Span</code> or
24        <code class="literal">span</code> is not the same as
25        <code class="literal">SPAN</code>.</p><p>To insert a special character such as &lt; or &gt; literally in
26        XML (for example, inside an attribute value), you must write it as an
27        <em class="firstterm">entity</em>. An entity consists of the character's
28        symbolic name enclosed within &#8220;<span class="quote">&amp;</span>&#8221; and &#8220;<span class="quote">;</span>&#8221;.
29        The most frequently used entities are:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">&amp;lt;</code> - The less-than (&lt;)
30                character</p></li><li><p><code class="literal">&amp;gt;</code> - The greater-than (&gt;)
31                character</p></li><li><p><code class="literal">&amp;amp;</code> - The ampersand (&amp;)
32                character</p></li></ul></div><p>For example, the following will cause a syntax error:</p><pre class="programlisting">&lt;SEQ TYPE="OPERATOR"&gt;&amp;&lt;/SEQ&gt;</pre><p>Instead, you must write:</p><pre class="programlisting">&lt;SEQ TYPE="OPERATOR"&gt;&amp;amp;&lt;/SEQ&gt;</pre><p>Now that the basics of XML have been covered, the rest of this
33        section will cover each construct in detail.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="writing-modes.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="writing-modes.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mode-preamble.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 10. Mode Definition Syntax </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The Preamble and MODE tag</td></tr></table></div></body></html>