<para> This is a paragraph in <term>CNXML</term>. Notice that the markup contains tags that express the meaning of it. </para>
para and term are the tags being
used. In XML, the opening (first) tag is surrounded by angle brackets
(< and >) and the closing (second) tag
is also surrounded by angle brackets, but the name of the tag is
preceded by a slash (/). Also, the closing tag never
contains any attribute information.
code tags: 'inline' (the code is included in the current
line of text) or 'block' (it is set apart from the text). This
information can be included in attributes,
which are nestled between the name of the opening tag and its 2nd angle
bracket (>), as in the example below:
<para> This is a paragraph written in <code type="inline">CNXML</code>. In the output, the word 'CNXML' would not be offset from the rest of the text. </para>
type is the attribute
name and inline is the attribute
value. The attribute name is always followed by the equal sign
(=) and the attribute value is always surrounded by double
or single quotes (" or '). In CNXML, the
attributes one can use for a given tag are strictly defined.
code tag is nested inside a para tag. It can
be said that code is a child of
para and that para is a parent of code. In XML, it is not
valid to write tags that do not properly nest, such as in this example,
where the emphasis tag ends before its child,
foreign, also ends:
It is <emphasis><foreign>muy</emphasis> importante</foreign> that you write proper XML.
<para> Shakespeare wrote both <cite>MacBeth</cite> and <cite>Hamlet</cite>. </para>
<, since that angle bracket (<) is parsed by the processors to mark the
beginning of an opening or closing tag. The following
characters should be escaped:
& (escaped by writing
&)< (escaped by writing
<)> (escaped by writing
>)<![CDATA[ and ending it with ]]>, as highlighted in this example:
<code type="block"> <![CDATA[ <html> <title>This is an HTML document</title> <body>This is its body text</body> </html> ]]> </code>
In CNXML, failing to add
the highlighted lines in the above code will result in a validation
error. The validator will interpret the <html> tag as unknown CNXML inside the <code> tag.