PageRenderTime 67ms CodeModel.GetById 61ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
HTML | 46 lines | 43 code | 3 blank | 0 comment | 0 complexity | 359e0e27800142899ad64e2d9779a70c 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.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="writing-modes.html" title="Chapter 10. Mode Definition Syntax"><link rel="previous" 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></div></div><p>
 2   A very simple XML file (which also happens to be an edit mode) looks like so:
 3  </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">&lt;?xml version="1.0"?&gt;
 4
 5&lt;!DOCTYPE MODE SYSTEM "xmode.dtd"&gt;
 6
 7&lt;MODE&gt;
 8    &lt;PROPS&gt;
 9        &lt;PROPERTY NAME="commentStart" VALUE="/*" /&gt;
10        &lt;PROPERTY NAME="commentEnd" VALUE="*/" /&gt;
11    &lt;/PROPS&gt;
12
13    &lt;RULES&gt;
14        &lt;SPAN TYPE="COMMENT1"&gt;
15            &lt;BEGIN&gt;/*&lt;/BEGIN&gt;
16            &lt;END&gt;*/&lt;/END&gt;
17        &lt;/SPAN&gt;
18    &lt;/RULES&gt;
19&lt;/MODE&gt;</pre></td></tr></table><p>
20   Note that each opening tag must have a corresponding closing tag.
21   If there is nothing between the opening and closing tags, for example
22   <tt class="literal">&lt;TAG&gt;&lt;/TAG&gt;</tt>, the shorthand notation
23   <tt class="literal">&lt;TAG /&gt;</tt> may be used. An example of this shorthand
24   can be seen
25   in the <tt class="literal">&lt;PROPERTY&gt;</tt> tags above.
26  </p><p>
27   XML is case sensitive. <tt class="literal">Span</tt> or <tt class="literal">span</tt>
28   is not the same as <tt class="literal">SPAN</tt>.
29  </p><p>
30   To insert a special character such as &lt; or &gt; literally in XML
31   (for example, inside an attribute value), you must write it as
32   an <i class="firstterm">entity</i>. An
33   entity consists of the character's symbolic name enclosed with
34   &#8220;<span class="quote">&amp;</span>&#8221; and &#8220;<span class="quote">;</span>&#8221;. The most frequently used entities
35   are:
36  </p><div class="itemizedlist"><ul type="disc"><li><p><tt class="literal">&amp;lt;</tt> - The less-than (&lt;)
37   character</p></li><li><p><tt class="literal">&amp;gt;</tt> - The greater-than (&gt;)
38   character</p></li><li><p><tt class="literal">&amp;amp;</tt> - The ampersand (&amp;)
39   character</p></li></ul></div><p>
40   For example, the following will cause a syntax error:
41  </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">&lt;SEQ TYPE="OPERATOR"&gt;&amp;&lt;/SEQ&gt;</pre></td></tr></table><p>
42   Instead, you must write:
43  </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">&lt;SEQ TYPE="OPERATOR"&gt;&amp;amp;&lt;/SEQ&gt;</pre></td></tr></table><p>
44   Now that the basics of XML have been covered, the rest of this
45   section will cover each construct in detail.
46  </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>