PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. &lt;!DOCTYPE MODE SYSTEM "xmode.dtd"&gt;
  5. &lt;MODE&gt;
  6. &lt;PROPS&gt;
  7. &lt;PROPERTY NAME="commentStart" VALUE="/*" /&gt;
  8. &lt;PROPERTY NAME="commentEnd" VALUE="*/" /&gt;
  9. &lt;/PROPS&gt;
  10. &lt;RULES&gt;
  11. &lt;SPAN TYPE="COMMENT1"&gt;
  12. &lt;BEGIN&gt;/*&lt;/BEGIN&gt;
  13. &lt;END&gt;*/&lt;/END&gt;
  14. &lt;/SPAN&gt;
  15. &lt;/RULES&gt;
  16. &lt;/MODE&gt;</pre></td></tr></table><p>
  17. Note that each opening tag must have a corresponding closing tag.
  18. If there is nothing between the opening and closing tags, for example
  19. <tt class="literal">&lt;TAG&gt;&lt;/TAG&gt;</tt>, the shorthand notation
  20. <tt class="literal">&lt;TAG /&gt;</tt> may be used. An example of this shorthand
  21. can be seen
  22. in the <tt class="literal">&lt;PROPERTY&gt;</tt> tags above.
  23. </p><p>
  24. XML is case sensitive. <tt class="literal">Span</tt> or <tt class="literal">span</tt>
  25. is not the same as <tt class="literal">SPAN</tt>.
  26. </p><p>
  27. To insert a special character such as &lt; or &gt; literally in XML
  28. (for example, inside an attribute value), you must write it as
  29. an <i class="firstterm">entity</i>. An
  30. entity consists of the character's symbolic name enclosed with
  31. &#8220;<span class="quote">&amp;</span>&#8221; and &#8220;<span class="quote">;</span>&#8221;. The most frequently used entities
  32. are:
  33. </p><div class="itemizedlist"><ul type="disc"><li><p><tt class="literal">&amp;lt;</tt> - The less-than (&lt;)
  34. character</p></li><li><p><tt class="literal">&amp;gt;</tt> - The greater-than (&gt;)
  35. character</p></li><li><p><tt class="literal">&amp;amp;</tt> - The ampersand (&amp;)
  36. character</p></li></ul></div><p>
  37. For example, the following will cause a syntax error:
  38. </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>
  39. Instead, you must write:
  40. </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>
  41. Now that the basics of XML have been covered, the rest of this
  42. section will cover each construct in detail.
  43. </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>