PageRenderTime 54ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/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
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.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. &lt;!DOCTYPE MODE SYSTEM "xmode.dtd"&gt;
  4. &lt;MODE&gt;
  5. &lt;PROPS&gt;
  6. &lt;PROPERTY NAME="commentStart" VALUE="/*" /&gt;
  7. &lt;PROPERTY NAME="commentEnd" VALUE="*/" /&gt;
  8. &lt;/PROPS&gt;
  9. &lt;RULES&gt;
  10. &lt;SPAN TYPE="COMMENT1"&gt;
  11. &lt;BEGIN&gt;/*&lt;/BEGIN&gt;
  12. &lt;END&gt;*/&lt;/END&gt;
  13. &lt;/SPAN&gt;
  14. &lt;/RULES&gt;
  15. &lt;/MODE&gt;</pre><p>Note that each opening tag must have a corresponding closing tag.
  16. If there is nothing between the opening and closing tags, for example
  17. <code class="literal">&lt;TAG&gt;&lt;/TAG&gt;</code>, the shorthand notation
  18. <code class="literal">&lt;TAG /&gt;</code> may be used. An example of this
  19. shorthand can be seen in the <code class="literal">&lt;PROPERTY&gt;</code> tags
  20. above.</p><p>XML is case sensitive. <code class="literal">Span</code> or
  21. <code class="literal">span</code> is not the same as
  22. <code class="literal">SPAN</code>.</p><p>To insert a special character such as &lt; or &gt; literally in
  23. XML (for example, inside an attribute value), you must write it as an
  24. <em class="firstterm">entity</em>. An entity consists of the character's
  25. symbolic name enclosed within &#8220;<span class="quote">&amp;</span>&#8221; and &#8220;<span class="quote">;</span>&#8221;.
  26. 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;)
  27. character</p></li><li><p><code class="literal">&amp;gt;</code> - The greater-than (&gt;)
  28. character</p></li><li><p><code class="literal">&amp;amp;</code> - The ampersand (&amp;)
  29. 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
  30. 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>