/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
- <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>
- A very simple XML file (which also happens to be an edit mode) looks like so:
- </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting"><?xml version="1.0"?>
- <!DOCTYPE MODE SYSTEM "xmode.dtd">
- <MODE>
- <PROPS>
- <PROPERTY NAME="commentStart" VALUE="/*" />
- <PROPERTY NAME="commentEnd" VALUE="*/" />
- </PROPS>
- <RULES>
- <SPAN TYPE="COMMENT1">
- <BEGIN>/*</BEGIN>
- <END>*/</END>
- </SPAN>
- </RULES>
- </MODE></pre></td></tr></table><p>
- Note that each opening tag must have a corresponding closing tag.
- If there is nothing between the opening and closing tags, for example
- <tt class="literal"><TAG></TAG></tt>, the shorthand notation
- <tt class="literal"><TAG /></tt> may be used. An example of this shorthand
- can be seen
- in the <tt class="literal"><PROPERTY></tt> tags above.
- </p><p>
- XML is case sensitive. <tt class="literal">Span</tt> or <tt class="literal">span</tt>
- is not the same as <tt class="literal">SPAN</tt>.
- </p><p>
- To insert a special character such as < or > literally in XML
- (for example, inside an attribute value), you must write it as
- an <i class="firstterm">entity</i>. An
- entity consists of the character's symbolic name enclosed with
- “<span class="quote">&</span>” and “<span class="quote">;</span>”. The most frequently used entities
- are:
- </p><div class="itemizedlist"><ul type="disc"><li><p><tt class="literal">&lt;</tt> - The less-than (<)
- character</p></li><li><p><tt class="literal">&gt;</tt> - The greater-than (>)
- character</p></li><li><p><tt class="literal">&amp;</tt> - The ampersand (&)
- character</p></li></ul></div><p>
- For example, the following will cause a syntax error:
- </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting"><SEQ TYPE="OPERATOR">&</SEQ></pre></td></tr></table><p>
- Instead, you must write:
- </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting"><SEQ TYPE="OPERATOR">&amp;</SEQ></pre></td></tr></table><p>
- Now that the basics of XML have been covered, the rest of this
- 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>