summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/otherformats/xmltex/base
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-24 00:31:38 +0000
committerKarl Berry <karl@freefriends.org>2009-05-24 00:31:38 +0000
commit3db8854079e5f66bff8e115d3e53b74a9e6b1b94 (patch)
treec76f77b61118c210746b2b9a513369908249ae7e /Master/texmf-dist/doc/otherformats/xmltex/base
parent631b5bbb9b2878fe0c658883d594124839413456 (diff)
move doc for lesser-used formats to subdirs
git-svn-id: svn://tug.org/texlive/trunk@13440 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/otherformats/xmltex/base')
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/englishutf16.xmlbin0 -> 194 bytes
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/englishutf8.xml6
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/langtest.xml21
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/manual.html882
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/manual.tex4
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/manual.xml799
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/manual.xsl29
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/portugeselatin1.xml7
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/readme.txt123
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/russiankoi8.xml9
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/russianutf8.xml7
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/testascii.cfg159
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/testascii.tex4
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/testascii.xml22
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/testsec.tex5
-rw-r--r--Master/texmf-dist/doc/otherformats/xmltex/base/testsec.xml77
16 files changed, 2154 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/englishutf16.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/englishutf16.xml
new file mode 100644
index 00000000000..c51d565faf7
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/englishutf16.xml
Binary files differ
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/englishutf8.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/englishutf8.xml
new file mode 100644
index 00000000000..6710da9b143
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/englishutf8.xml
@@ -0,0 +1,6 @@
+<document att="english">
+ <section>
+ <head>Test</head>
+ Hello World!
+ </section>
+</document>
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/langtest.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/langtest.xml
new file mode 100644
index 00000000000..081cfe06833
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/langtest.xml
@@ -0,0 +1,21 @@
+
+<!DOCTYPE langtest [
+
+<!ENTITY englishutf8 SYSTEM "englishutf8.xml">
+<!ENTITY portugeselatin1 SYSTEM "portugeselatin1.xml">
+<!ENTITY englishutf16 SYSTEM "englishutf16.xml">
+<!ENTITY russiankoi8 SYSTEM "russiankoi8.xml">
+<!ENTITY russianutf8 SYSTEM "russianutf8.xml">
+
+]>
+
+<langtest>
+
+&englishutf8;
+&englishutf16;
+&portugeselatin1;
+&russiankoi8;
+&russianutf8;
+
+
+</langtest>
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/manual.html b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.html
new file mode 100644
index 00000000000..2c88af23dfa
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.html
@@ -0,0 +1,882 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html xmlns:lxslt="http://xml.apache.org/xslt" xmlns:saxon="http://icl.com/saxon" xmlns:xalan="org.apache.xalan.xslt.extensions.Xalan">
+<head>
+<title>
+ xmltex: A non validating (and not 100%
+ conforming) namespace aware XML parser implemented in TeX
+ </title>
+<link rel="stylesheet" type="text/css" href="http://www.oucs.ox.ac.uk/stylesheets/tei-oucs.css">
+</head>
+<body>
+<table width="100%">
+<tr>
+<td rowspan="2"></td><td align="left">
+<h2>Numerical Algorithms Group: NAG</h2>
+</td>
+</tr>
+<tr>
+<td align="left">
+<h1>
+ xmltex: A non validating (and not 100%
+ conforming) namespace aware XML parser implemented in TeX
+ </h1>
+</td>
+</tr>
+</table>
+<hr>
+ <h2>
+ xmltex: A non validating (and not 100%
+ conforming) namespace aware XML parser implemented in TeX
+ </h2>
+ Date: 2000-02-02
+ <h2>
+<it>davidc@nag.co.uk</it>
+</h2>
+ <h2>
+<it>David Carlisle</it>
+</h2>
+<h2>Contents</h2>
+<p>
+<div class="subtoc">
+<ul>
+<li>
+<a class="subtoc" href="#intro">Introduction</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN211">Installation</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN343">Using xmltex</a>
+</li>
+<li>
+<a class="subtoc" href="#stopping">Stopping xmltex</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN651">xmltex package files</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN1004">XML processing</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN1059">Accessing TeX</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN1146">Bugs</a>
+</li>
+<li>
+<a class="subtoc" href="#manualN1161">Don't Read Past This Point</a>
+</li>
+</ul>
+</div>
+</p>
+<h2>
+<a name="intro"></a>Introduction</h2>
+
+<p>
+xmltex implements
+a non validating parser for documents matching the
+W3C XML Namespaces Recommendation.
+
+
+The system may just be used to parse the file (expanding entity
+references and normalising namespace declarations) in which case it
+records a trace of the parse on the terminal. Normally however the
+information from the parse is used to trigger TeX typesetting code.
+Declarations (in TeX syntax) are provided as part of xmltex to
+associate TeX code with the start and end of each XML element,
+attributes, processing instructions, and with unicode character data.
+</p>
+
+
+<h2>
+<a name="manualN211"></a>Installation</h2>
+
+<p>The xmltex parser itself does not require LaTeX. It may be loaded
+into initex to produce a format capable of parsing XML files. However
+such a format would have no convenient commands for typesetting, and
+so normally xmltex will be used on top of an existing format, normally
+LaTeX. In this section we assume that the document to be
+processed is called <tt>document.xml</tt>.
+</p>
+<h3>
+<a name="manualN228"></a>Using xmltex as an input to the LaTeX command</h3>
+
+<p>LaTeX requires a document in TeX syntax, not XML. To process
+<tt>document.xml</tt>, first produce a two line file called
+<tt>document.tex</tt> of the following form:
+<pre>
+\def\xmlfile{document.xml}
+\input xmltex.tex
+</pre>
+
+Do <em>not</em> put any other commands in this file!</p>
+<p>You may then process the document with either of the commands:
+<tt>latex document</tt> or <tt>latex document.tex</tt>
+or the equivalent procedure in your TeX environment.
+</p>
+
+<h3>
+<a name="manualN267"></a>Using xmltex as a TeX format built on LaTeX</h3>
+
+<p>
+You may prefer to set up xmltex as a format in its own right.
+This may speed things up slightly (as <tt>xmltex.tex</tt> does not
+have to be read each time) but more importantly perhaps it allows the
+XML file to be processed directly without needing to make the
+<tt>.tex</tt> wrapper.</p>
+<p>To make a format you will need a command such as the following,
+depending on your TeX system.
+<pre>
+initex &amp;latex xmltex
+initex \&amp;latex xmltex
+tex -ini &amp;latex xmltex
+tex -ini \&amp;latex xmltex
+</pre>
+</p>
+<p>This will produce a format file <tt>xmltex.fmt</tt>. You should then
+be able to make a <tt>xmltex</tt> command by copying the way the
+<tt>latex</tt> command is defined in terms of
+<tt>latex.fmt</tt>. Depending on the TeX system, this might be a
+symbolic link, or a shell script, or batch file, or a configuration
+option in a setup menu.
+
+</p>
+
+<h3>
+<a name="manualN311"></a> Making an xmltex format `from scratch'</h3>
+
+<p>
+Whilst it may be convenient to build an xmltex format as above, starting
+from the LaTeX format. You may prefer to instead work with an initex
+with no existing format file. Even if you wish to use a standard LaTeX
+it may be preferable to make a TeX input file that first inputs
+<tt>latex.ltx</tt> then <tt>xmltex.tex</tt>. In particular this
+will allow you to have a different hyphenation and language
+customisation for xmltex than for LaTeX. Many of the features of
+the language support in LaTeX are related to modifying the input
+syntax to be more convenient. Such changes are not needed in xmltex as
+the input syntax is always XML. Some language files may change the
+meaning of such characters as &lt; which would break the xmltex parser.
+Also, rather than using <tt>latex.ltx</tt> you could in principle
+use a modified <tt>docstrip</tt> install file and produce a
+`cut down' latex that did not have features that are not going to be
+used in xmltex.
+</p>
+<p>
+Unfortunately the support for this method of building xmltex (and access
+to non English hyphenation generally) is not fully designed and totally
+undocumented.</p>
+
+
+<h2>
+<a name="manualN343"></a>Using xmltex</h2>
+
+<p>
+xmltex by default `knows' nothing about any particular type of XML
+file, and so needs to load external files containing specific
+information. This section describes how the information in the XML
+file determines which files will be loaded.
+
+<ol>
+<li> If the file begins with a Byte Order Mark, the default encoding
+ is set to utf-16. Otherwise the default encoding is utf-8.
+</li>
+<li> If (after an optional BOM) the document begins with an XML
+ declaration that specifies an encoding, this encoding will be used,
+ otherwise the default encoding will be used. A file with name of the
+ form <em>encoding</em><tt>.xmt</tt> will be loaded that maps the
+ requested encoding to Unicode positions. (It is an error if this
+ file does not exist for the requested encoding.)
+</li>
+<li> If the document has a <tt>DOCTYPE</tt> declaration that includes
+ a local subset then this will be parsed. If any external DTD entity
+ is referenced (by declaring and then referencing a parameter entity)
+ then the SYSTEM and PUBLIC identifiers of this entity will be looked
+ up in a catalogue (to be described below). If either identifier is
+ known in the catalogue the corresponding xmltex package (often with
+ <tt>.xmt</tt> extension) will be loaded.
+</li>
+<li> After any local subset has been processed, if the DOCTYPE
+ specifies an external entity, the PUBLIC and/or SYSTEM identifiers
+ of the external dtd file will be similarly looked up, and a
+ corresponding xmltex file loaded if known.
+</li>
+<li> As each element is processed, it may be `known' to xmltex by
+ virtue of one of the packages loaded, or it may be unknown. If it is
+ unknown then if it is in a declared namespace, the namespace URI
+ (not the prefix) is looked up in the xmltex catalogue. If the
+ catalogue specifies an xmltex package for this namespace it will be
+ loaded. If the element is not in a namespace, then the element name
+ will be looked up in the catalogue.
+</li>
+<li> If after all these steps the element is still unknown then
+ depending on the configuration setting either a warning or an error
+ will be displayed. (Currently only warning implemented.)
+</li>
+</ol>
+</p>
+<h3>
+<a name="manualN398"></a>The xmltex Catalogue</h3>
+<p>As discussed above, xmltex requires a mapping between PUBLIC and
+SYSTEM identifiers, namespace URI, and element names, to files of
+TeX code. This mapping is implemented by the following commands:
+<pre>
+<tt>\NAMESPACE</tt>{<em>URI</em>}{<em>xmt-file</em>}
+<tt>\PUBLIC</tt>{<em>FPI</em>}{<em>file</em>}
+<tt>\SYSTEM</tt>{<em>URI</em>}{<em>file</em>}
+<tt>\NAME</tt>{<em>element-name</em>}{<em>xmt-file</em>}
+<tt>\XMLNS</tt>{<em>element-name</em>}{<em>URI</em>}
+</pre>
+As described above, if the first argument of one of these commands
+matches the string specified in the XML source file, the corresponding
+TeX commands in the file specified in the second argument are
+loaded. The PUBLIC and SYSTEM catalogue entries may also be used
+to control which XML files should be input in response to external
+entity references. The <tt>\XMLNS</tt> is rather different,
+if an element in the null namespace does not have any definition
+attatched to it, this declaration forces the default namespace to the
+given URI. The catalogue lookup is then repeated. This allows for
+example documents beginning <tt>&lt;html&gt;</tt> to be coerced into
+the xhtml namespace.</p>
+<p>These commands may be placed in a configuration file, either
+<tt>xmltex.cfg</tt>, in which case they apply to all documents,
+or in a configuration file `<tt>\jobname.cfg</tt>' (eg
+<tt>document.cfg</tt> in the example in the Introduction) in which
+case the commands just apply to the specified document.
+</p>
+
+
+<h3>
+<a name="manualN490"></a>Configuring xmltex</h3>
+
+<p>In addition to the `catalogue' commands described earlier there are
+other commands that may be placed in the configuration files.
+
+<ul>
+<li> <p>
+<tt>\xmltraceonly</tt>
+</p>
+<p> This stops xml from trying to typeset the
+ document. The external files specified in the catalogue are still
+ loaded, so that the trace may report any elements for which no code
+ is defined, but no actual typesetting takes place. In the event of
+ unknown errors it is always worth using xmltex in this mode to
+ isolate any problems.</p>
+<p>It may be noted that if an xmltex format is built just using initex
+without any typesetting commands, the resulting format should still
+be able to parse any XML file if xmltex.cfg just specifies
+<tt>\xmltraceonly</tt> and \jobname.cfg is empty.</p>
+</li>
+<li> <p>
+<tt>\xmltraceoff</tt>
+</p>
+<p>By default xmltex provides a trace of its XML parse, displaying
+ each element begin and end. This command used in xmltex.cfg or
+ `\jobname.cfg' will stop this trace being produced.</p>
+</li>
+
+<li>
+<p> <tt>\inputonce</tt>{<em>xmt-file</em>}</p>
+<p>The catalogue entries specify that
+ certain files should be loaded if XML constructs are met.
+ Alternatively the files may just always be loaded. The system will
+ ignore any later requests to load. This is especially useful if an
+ xmltex format is being made.</p>
+</li>
+<li>
+<p>
+<tt>\UnicodeCharacter</tt>{<em>hex-or-dec</em>}{<em>tex-code</em>}</p>
+<p>The first argument specifies a unicode character number, in the same
+format as used for XML character entities, namely either a decimal
+number, or an upper case Hex number preceded by a lower case
+`<tt>x</tt>'.</p>
+<p>The second argument specifies arbitrary TeX code to be used when
+typesetting this character. Any code in the XML
+range may be specified (ie up to x10FFFF). Although codes in the
+`ASCII' range, below 128, may be specified, the definitions supplied
+for such characters will not be default be used. The definition will
+howeverbe stored and used if the character is activated using the
+command described below.</p>
+</li>
+<li> <p>
+<tt>\ActivateASCII</tt>{<em>hex-or-dec</em>}</p>
+<p>The argument to this command should be a number less than 128.
+If a character us activated by this command in a configuration file
+then any special typesetting instructions specified for the character
+will be executed whenever the character appears as character data.</p>
+<p>Some ASCII characters are activated by default. The list is
+essentially those characters with special meanings to either TeX or
+XML.</p>
+</li>
+
+</ul>
+</p>
+<p>
+If a format is being made, there are essentially two copies of
+<tt>xmltex.cfg</tt> that may play a role. The configuration file
+input when the format is made will control catalogue entries and
+packages built into the format. A possibly different
+<tt>xmltex.cfg</tt> may be used in the input path of `normal' TeX,
+this will then be used for additional information loaded each run.</p>
+<p>In either case, a separate configuration file specific to the given
+XML document may also be used (which is loaded immediately after
+<tt>xmltex.cfg</tt>).
+</p>
+
+
+
+<h2>
+<a name="stopping"></a>Stopping xmltex</h2>
+
+<p>xmltex should stop after the end of the document
+element has been processed. If things go wrong and
+you end up at the interactive
+<tt>*</tt> prompt you might want to exit with
+<tt>&lt;?xmltex \stop?&gt;</tt>).
+</p>
+
+
+<h2>
+<a name="manualN651"></a>xmltex package files</h2>
+
+<p>
+xmltex package files are the link between the XML markup and TeX
+typesetting code. They are written in TeX (rather than XML) syntax
+and may load directly or indirectly other files, including LaTeX
+class and package files. For example a file loaded for a particular
+document type may directly execute <tt>\LoadClass{article}</tt>, or
+alternatively it may cause some XML element in the document to
+execute <tt>\documentclass{article}</tt>. In either case the document will
+suffer the dubious benefit of being formatted based on the style
+implemented in <tt>article.cls</tt>. Beware though that the package
+files may be loaded at strange times, the first time a given namespace
+is declared in a document, and so the code should be written to work
+if loaded inside a local group.</p>
+<p>Characters in xmltex package files have their normal LaTeX meanings
+except that line endings are ignored so that you do not need to add
+a % to the end of lines in macro code. Unlike fd file conventions, other
+white space is <em>not</em> ignored.</p>
+<p>The available commands are:
+
+<ul>
+<li>
+<p>
+<tt>\FileEncoding</tt>{<em>encoding</em>}</p>
+<p>This is the analogue for TeX syntax files of the encoding specification
+in the XML or text declaration of XML files. If it is not specified the
+file will be assumed to be in UTF-8.</p>
+</li>
+
+<li>
+<p>
+<tt>\DeclareNamespace</tt>{<em>prefix</em>}{<em>URI</em>}</p>
+<p>This declares a prefix to be used <em>in this file</em> for referring to
+elements in the specified namespace. If the prefix is empty then this
+declares the default namespace (otherwise, unprefixed element names
+refer to elements that are not in a namespace).</p>
+<p>Note that the elements in the XML document instance may use a
+different prefix, or no prefix at all to access this namespace.
+In order to resolve these different prefixes for the same namespace,
+each time a namespace is encountered for the first time (either
+by <tt>\DeclareNamespace</tt> in a preloaded package, or in a namespace
+declaration in the XML instance) then it is allocated a new number
+and any further namespace declaration for the same URI just locally
+associates a prefix with this number. It is these numbers that are
+displayed when the XML trace of the parse of the document is shown,
+and also if any element is written out to an external file it will
+have a normalised prefix of a number whichever prefix it had
+originally. (Numeric prefixes are not legal XML, but this is an
+advantage, it ensures these internal forms can not clash with any
+prefix actually used in the document.)</p>
+<p>Three namespaces are predeclared. The null namespace (0), the XML
+namespace (<tt>http://www.w3.org/1998/xml</tt>) (1) which is predeclaed
+with prefix <tt>xml</tt> as specified in the Namespace Recommendation,
+and the xmltex namespace
+(<tt>http://www.dcarlisle.demon.co.uk/xmltex</tt>) (2) which is not
+given a default prefix, but may be used to have XML syntax for some
+internal commands (eg to have .aux files fully in XML, currently they
+are a hybrid mixture of some TeX and some XML syntax).
+</p>
+</li>
+<li>
+<p>
+ <tt>\XMLelement</tt>{<em>element-qname</em>}{<em>attribute-spec</em>}
+{<em>begin-code</em>}{<em>end-code</em>}</p>
+<p> This is similar to a LaTeX <tt>\newenvironment</tt> command.</p>
+<p> Declare the code to execute at the start and end of each instance of
+this element type. This code will be executed in a local group (like a
+LaTeX environment). The second argument declares a list of attributes
+and their default values using the <tt>\XMLattribute</tt> command
+described below.
+</p>
+</li>
+<li>
+<p>
+ <tt>\XMLelement</tt>{<em>element-qname</em>}
+{<em>attribute-spec</em>}
+<tt>{\xmlgrab}</tt>{<em>end-code</em>}</p>
+<p> A special case of the above command (which may be better made into a
+ separate declaration) is to make the <em>start-code</em> just be the command
+ <tt>\xmlgrab</tt>. In this case the <em>end-code</em> has access to the
+ element content (in XML syntax) as <tt>#1</tt>. This content isn't
+ literally the same as the original document, namespaces, white space
+ and attribute quote symbols will all have been normalised.
+</p>
+</li>
+<li> <p>
+ <tt>\XMLattribute</tt>{<em>attribute-qname</em>}
+{<em>command-name</em>}{<em>default</em>}</p>
+<p>This command may only be used in the argument to
+<tt>\XMLelement</tt>.
+ The first argument specifies the name of an attribute (using any
+ namespace prefixes current for this package file, which need not
+ be the same as the prefixes used in the document).
+ The second argument gives a TeX command name that will be used to
+ access the value of this attribute in the begin and end code for the
+ element. (Note using TeX syntax here provides a name independednt of
+ the namespace declarations that are in scope when this code is executed).
+ The third argument provides a default value that wil be used if the
+attribute is not used on an instance of this element.
+ </p>
+<p>The special token <tt>\inherit</tt> may be used which will cause
+the command to have a value set in an ancestor element if this element
+does not specify any value.</p>
+<p>If a TeX token such as <tt>\relax</tt> is used as the default
+the element code may distinguish the case that the attribute is not used
+in the document.</p>
+</li>
+<li> <p>
+ <tt>\XMLnamespaceattribute</tt>
+{<em>prefix</em>}{<em>attribute-qname</em>}
+{<em>command-name</em>}{<em>default</em>}</p>
+<p>This command is similar to <tt>\XMLattribute</tt>
+ but is used at the top level of the package file, not in the argument
+to <tt>\XMLelement</tt>. It is equivalent to specifying the
+attribute in <em>every</em> element in the namespace specified by
+the first argument. As usual the prefix (which may be {} to denote the
+default namespace) refers to the namespace declarations in the xmltex
+package: the prefixes used in the document may be different.</p>
+</li>
+
+<li>
+<p>
+<tt>\XMLentity</tt>{<em>name</em>}{<em>code</em>}</p>
+<p>Declare an (internal parsed) entity, this is equivalent to a
+<tt>&lt;!ENTITY</tt> declaration, except that the
+replacement text is specified in TeX syntax.</p>
+</li>
+
+<li>
+<p>
+<tt>\XMLname</tt>{<em>name</em>}{<em>command-name</em>}</p>
+<p>Declare the TeX command to hold the (normalised, internal form) of
+the XML name given in the first argument. This allows the code specified in
+<tt>\XMLelement</tt> to refer to XML element names without knowing
+the encodings or namespace prefixes used in the document. Of particular
+use might be to compare such a name with <tt>\ifx\XML@parent</tt>
+which will allow element code to take different actions depending on
+the parent of the current element.</p>
+</li>
+
+
+<li>
+<p>
+<tt>\XMLstring</tt>{<em>command-name</em>}&lt;&gt;<em>XML Data</em>&lt;/&gt;</p>
+<p>This saves the XML fragment as the TeX command given in the first
+argument. It may be particularly useful for redefining `fixed strings'
+that are generated by LaTeX document classes to use any special
+typesetting rules specified for individual characters.</p>
+<p>It should also be used for defining any strings used to
+in comparison tests with strings occurring in the XML document.
+Using <tt>\XMLstring</tt> rather than <tt>\def</tt> ensures
+that the characters and encodings in the string are correctly normalised.</p>
+</li>
+
+
+</ul>
+
+</p>
+
+<h2>
+<a name="manualN1004"></a>XML processing</h2>
+
+<p>
+xmltex tries as far as possible to be a fully conforming non
+validating parser. It fails in the following respects.
+<ul>
+<li> Error reporting is virtually non existent. Names are not checked
+ against the list of allowed characters, and various other
+ constraints are not enforced.
+</li>
+<li>
+<p> A non validating parser is not forced to read external dtd
+ entities (and this one does not) It is obliged to read the local
+ subset and process entity definitions and attribute declarations.
+ Entity declarations are reasonably well handled: External parameter
+ entities are handled as above, loading a corresponding xmltex file
+ if known. External entities are similarly processed, inputting
+ the XML file, a difference in this case is that if the entity is not
+ found in the catalogue, the SYSTEM identifier will be used directly
+ to <tt>\input</tt> as often this is a local file reference. Internal
+ parsed entities and parameter entities are essentially treated as
+ TeX macros, and nonparsed entities are saved along with their
+ NDATA type, for use presumably by <tt>\includegraphics</tt>.</p>
+<p>Attribute defaults are processed in the local subset of the dtd, however
+ note that this is `namespace unaware' defaulting and only applies to
+ elements using the same prefix and local name, unlike the defaulting
+ done by <tt>\XMLattribute</tt>. </p>
+</li>
+<li>
+<p> Support for encodings depends on having an encoding mapping
+ file. Any 8bit encoding that matches Unicode for the first 127 positions
+ may be used by making a trivial mapping file. (The one for latin1
+ looks over complicated as it programs a loop rather than having 127
+ declarations saying that latin1 and Unicode are identical in this
+ range).</p>
+<p> UTF-8 is supported, but support for UTF-16 is minimal. Currently
+ only latin-1 values work: (In this range UTF-16 is just latin-1 with
+ a null byte inserted after (or before, depending on endedness)
+ each latin-1 byte. The UTF-16 implementation just ignores this null
+ byte then processes as for latin-1. Probably the first few 8bit
+ pages could be similarly supported by making the low ascii control
+ characters activate UTF-16 processing but this will never be
+ satisfactory using a standard TeX. Hopefully a setup for a 16bit
+ TeX such as Omega will correct this.</p>
+</li>
+</ul>
+
+</p>
+
+<h2>
+<a name="manualN1059"></a>Accessing TeX</h2>
+
+<p>In theory you should be able to control the document just be suitable
+code specified by <tt>\XMLelement</tt> and friends, but sometimes it may be
+necessary to `tweak' the output by placing commands directly in the
+source.</p>
+<p>Two mechanisms are availalable to do this.
+<ul>
+<li>
+<p> Using the xmltex namespace. The xmltex namespace conatins a
+ small (currently empty) set of useful TeX constructs that are
+ accessed by XML syntax. For example if xmltex provides a mechanism
+ for having XML (rather than LaTeX) syntax toc files, it will need
+ an analogue of <tt>\contentsline</tt> which might be an element
+ accessed by <tt>&lt;xmltex:contentsline&gt;</tt>&hellip; where the xmltex
+ prefix is declared on this or a parent element to be
+ <tt>xmlns:xmltex="http://www.dcarlisle.demon.co.uk/xmltex"</tt>.</p>
+<p> As the xmltex namespace is declared but currently empty, a more
+ useful variant of this might be:</p>
+</li>
+<li> Declare your own namespace for TeX tweaks, and load a suitable
+ package file that attatches TeX code to the elements in this
+ namespace (or at least specify the correspondence between the
+ namespace and the package using <tt>\NAMESPACE</tt>).
+ For instance if you put <tt>&lt;clearpage xmlns="/my/tex/tweak"/&gt;</tt>
+ in your document, this will force a page break if you have at
+ suitable points, <tt>\NAMESPACE{/my/tex/tweak}{tweak.xmt}</tt>
+ and
+<pre>
+\DeclareNamespace{tweak}{"/my/tex/tweak"}
+\XMLelement{tweak:clearpage}{\clearpage}
+</pre>
+</li>
+<li>
+<p> A second different mechanism is available, to use XML processing
+ instructions. A Processing Instruction of the form:
+<tt>&lt;?xmltex&gt;</tt> <em>TeX commands</em> <tt>?&gt;</tt>
+will execute the TeX commands.</p>
+</li>
+</ul>
+
+</p>
+
+
+<h2>
+<a name="manualN1146"></a>Bugs</h2>
+
+<p>None, of course.</p>
+
+
+<h2>
+<a name="manualN1161"></a>Don't Read Past This Point</h2>
+
+<p>Thus section discusses some of the more experimental features of xmltex
+that may get a cleaner syntax (or be removed, as a bad idea) in later releases,
+and also describes some of the internal interfaces (which are also
+subject to change)</p>
+
+<h3>
+<a name="manualN1175"></a>Input Encodings and States</h3>
+
+<p>At any point while processing a document, xmltex is in one of two
+<em>states</em>: <em>tex</em> or <em>xml</em>.</p>
+<h4>
+<a name="manualN1201"></a>States</h4>
+<p>In the xml <em>state</em>,
+ &lt; and &amp; are the only two characters that
+trigger special markup codes. Other characters, such as !, &gt;, =,
+&hellip; may be used in certain XML constructs as markup but unless
+some code has been triggered by &lt; they are treated simply as
+character data. All characters above 127 are `active' to TeX
+and are used to translate the input encoding to UTF-8. All internal
+character handling is based on UTF-8, as described below. Some
+characters in the ASCII range, below 127 are also active by default
+(mainly punctuation characters used in XML constructs, such as
+the ones listed above). Some or all of the others may be activated
+using the <tt>\ActivateASCII</tt> command, which allows special
+typesetting rules to be activated for the characters, at some cost in
+processing speed.</p>
+<p>In the tex <em>state</em>,
+characters in the ASCII range have their usual
+TeX meanings, so letters are `catcode 11' and may be used in TeX
+control sequences, \ is the escape character, &amp; the table cell
+separator, etc. Characters above 127 have the meanings current for the
+current encoding just as for the xml state, probably this means that
+they are unusable in TeX code, except for the special case of
+referring to XML element names in the first argument to
+<tt>\XMLelement</tt> and releated commands.</p>
+
+<h4>
+<a name="manualN1233"></a>Encodings</h4>
+<p>Whenever a new (XML or TeX) file is input by the xmltex system the
+<em>encoding</em> is first switched to UTF-8. At the end of the
+input the encoding is returned to whatever was the current encoding.
+The encoding current while the file is read is determined by the
+encoding pseudo-attribute on the XML or text declaration in the case
+of XML files, or by the <tt>\FileEncoding</tt> command for TeX
+files. Note that the encoding mechanism <em>only</em> is triggered
+by xmltex file includes. Once an xmltex package file is loaded it may
+include other TeX files by <tt>\input</tt> or
+<tt>\includepackage</tt> these input command swill be transparent
+to the xmltex encoding system. The vast majority of TeX macro
+packages only use ASCII characters so this should not be a
+problem.</p>
+<p>Note that if the <tt>\includepackage</tt> occurs directly in
+the xmltex package file, the TeX code will be included with a known
+encoding, the one specified in the xmltex package, or UTF-8. If
+however the <tt>\includepackage</tt> is included in code specified
+by <tt>\XMLelement</tt>, then it will be executed with whatever
+encoding is current in the document at the point that element is
+reached. Before xmltex executes the code for that element it will
+switch to the tex state, thus normalising the ascii characters
+but characters above 127 will not have predefined definitions in this
+case.</p>
+<p>Internally eveything is stored as UTF-8. So `aux' and `toc' files
+will be in UTF-8 even if the document (or parts of the document) used
+different encodings.</p>
+<p>To specify a new encoding, if it is an 8 bit encoding that matches
+ASCII in the printable ASCII range, then one just needs to produce a
+file with name <em>encoding</em><tt>.xmt</tt> (in lowercase,
+on case sensitive systems) this should consist of a series of
+<tt>\InputCharacter</tt> commands, giving the input character slot
+and the equivalent Unicode. If an encoding is specified in this manner
+character data will be converted to UTF-8 by <em>expansion</em>
+and so ligatures and inter letter kerns will be preserved. (Conversely
+if characers are accessed by character references, &amp;#1234; then
+TeX arithmetic is used to decode the information and ligature
+information will be lost. For some large character sets, especially
+for Asian languages, these mechanisms will probably not prove to be
+sufficient, some mechanisms are being investigated, but in the short
+term it may be necessary to always use UTF-8 if the input encoding
+is not strictly a ine byte extension of the ASCII code page.
+</p>
+
+
+
+<h3>
+<a name="manualN1298"></a>xmltex Package Commands</h3>
+
+<p>You can use arbitrary TeX commands in an xmltex package,
+althought you should be aware that the file may be input into a local
+group, at the point in a document that a particular namespace is first
+used, for example. There are however some specific commands designed
+to be used in the begin or end code of <tt>\XMLElement</tt>.
+<ul>
+
+<li>
+<p>
+<tt>\ignorespaces</tt>
+</p>
+<p>This is actually a TeX primitive
+(for the moment!)</p>
+</li>
+
+<li>
+<p>
+<tt>\obeyspaces</tt>
+</p>
+<p>Obey consecutive space characters,
+rather than treating consecutive runs as a single space.
+(A command of this name, but not this definition is in plain TeX.)</p>
+</li>
+
+<li>
+<p>
+<tt>\obeylines</tt>
+</p>
+<p>Obey end of line characters,
+rather than treating then as a space, force a line break.
+(A command of this name, but not this definition is in plain TeX.)</p>
+</li>
+
+<li>
+<p>
+<tt>\xmltexfirstchild#1\@</tt>
+</p>
+<p>If the <em>start-code</em> for an element is specified as
+<tt>\xmlgrab</tt> then the <em>end-code</em> may use
+<tt>#1</tt> in order to execute the element content. Sometimes you
+do not want all of the content. The a construction (with currently
+unpleasant syntax) <tt>\xmltexfirstchild#1\@</tt> will just evaluate
+the first child element of the content, discarding the remaining
+elements.</p>
+</li>
+
+<li>
+<p>
+<tt>\xmltextwochildren\csa\csb#1</tt>
+</p>
+<p>If you know that the content will be exactly two child elements (for
+examle a MathML frac or sub element) then this command may be used.
+It will execute the TeX code
+<tt>\csa{</tt><em>child-1</em><tt>}\csb{</tt><em>child-2</em>
+So either two TeX command smay be supplied, one will be applied to
+each child, or the second argument may be <tt>{}</tt> in which case
+the first argument may be a TeX command that takes two arguments.
+For example the code for MathMl frac might be
+<pre>
+\XMLelement{m:mfrac}
+ {}
+ {\xmlgrab}
+ {\xmltextwochildren\frac{}#1}
+</pre>
+</p>
+</li>
+
+<li>
+<p>
+<tt>\xmltexthreechildren\csa\csb\csc#1</tt>
+</p>
+<p>As above, but more so.</p>
+</li>
+
+<li>
+<p>
+<tt>\xmltexforall\csa{#1}</tt>
+</p>
+<p>The TeX command <tt>\csa</tt> is called repeatedly,
+taking each child element of the current element as argument
+on each iteration. As a convenience the command <tt>\xml@name</tt>
+is defined before each iteration to have the (internal, normalised)
+name of the element being processed.</p>
+</li>
+
+<li>
+<p>
+<tt>\NDATAEntity\csa\csb\attvalue</tt>
+</p>
+<p>If the XML parser encounters an internalor external entity reference
+it expands it without executing any special hook that may be defined in
+an xmltex package. However NDATA entites are never directly encountered
+in an entity reference. They may only be used as an attribute value.
+If <tt>\attvalue</tt>. is a TeX command holding the value of an
+attribute, as declared in <tt>\XMLattribute</tt> then
+<tt>\NDATAEntity\csa\csb\attvalue</tt> applies the two TeX
+commands <tt>\csa</tt> and <tt>\csb</tt> to the notation type
+and the value, in a way exactly corresponding to
+<tt>\xmltextwochildren</tt> so for example the XML document for this
+manual specifies
+<pre>
+ &lt;!NOTATION URL SYSTEM "" &gt;
+ &lt;!ENTITY lppl SYSTEM "http://www.latex-project.org/lppl.txt" NDATA URL&gt;
+</pre>
+and this is handled by the following xmltex code
+<pre>
+\XMLelement{xptr}
+ {\XMLattribute{doc}{\xptrdoc}{}}
+ {\NDATAEntity\xptrdoc\@gobble\url}
+ {}
+</pre>
+which saves the attribute value in <tt>\xptrdoc</tt> and then
+discards the notation name (URL) and applies the command
+<tt>\url</tt> to typeset the supplied URL.
+</p>
+</li>
+
+</ul>
+</p>
+
+
+
+<h3>
+<a name="manualN1489"></a>Character Data Internals</h3>
+
+<p>
+<div align="center">
+<table>
+<tr>
+<td></td> <td>int.</td><td>ext. xml</td>
+<td>ext. mixed</td><td>csn typeout</td>
+<td></td>
+</tr>
+<tr>
+<td>d</td><td>xabc</td><td>xabc</td>
+<td>xabc (12)</td><td>xabc (12)</td><td>xabc (12)</td>
+<td></td>
+</tr>
+<tr>
+<td>c</td><td>xab</td><td>xab</td>
+<td>xab (12)</td><td>xab (12)</td><td>xab (12)</td>
+<td></td>
+</tr>
+<tr>
+<td>b</td><td>xa</td><td>xa</td>
+<td>xa (12)</td><td>xa (12)</td><td>xa (12)</td>
+<td></td>
+</tr>
+<tr>
+<td>ax</td><td>x</td><td>x</td>
+<td>x</td><td>x</td><td>x (12)</td>
+<td>(!)</td>
+</tr>
+<tr>
+<td>ay</td><td>x</td><td>x</td>
+<td>x</td><td>&amp;#123;</td><td>x (12)</td>
+<td>(e)</td>
+</tr>
+<tr>
+<td>az</td><td>x</td><td>\az x</td>
+<td>&amp;#123;</td><td>&amp;#123;</td><td>x (12)</td>
+<td>(&amp;lt;)</td>
+</tr>
+<tr>
+<td>&lt;</td><td>&lt;</td><td>&lt;</td>
+<td>&lt;</td><td>&lt;</td><td>&lt; (12)</td>
+<td>(&lt;)</td>
+</tr>
+</table>
+</div>
+
+</p>
+
+
+
+
+
+
+<hr>
+<div align="center">
+[<a href="http://www.tei-c.org/">NAG</a>
+| <a href="http://www.nag.co.uk/">NAG</a>
+]
+ </div>
+<hr>
+<address>
+ Last updated: Date: 2000-02-02.
+ <br> Copyright 2000 David Carlisle, NAG
+
+<!--Created by a version 1
+ XSLT stylesheet by James Clark--></address>
+</body>
+</html>
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/manual.tex b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.tex
new file mode 100644
index 00000000000..d788efe2fe9
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.tex
@@ -0,0 +1,4 @@
+\def\xmlfile{manual.xml}
+\input xmltex
+
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/manual.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.xml
new file mode 100644
index 00000000000..610938913ff
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.xml
@@ -0,0 +1,799 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE TEI.2 SYSTEM "http://www.oucs.ox.ac.uk/dtds/tei-oucs.dtd" [
+
+ <!NOTATION URL SYSTEM "" >
+ <!ENTITY lppl SYSTEM "http://www.latex-project.org/lppl.txt" NDATA URL>
+
+ <!ENTITY ldots "&#x2026;">
+
+ <!ENTITY TeX "TeX">
+ <!ENTITY LaTeX "LaTeX">
+
+]>
+<TEI.2>
+ <teiHeader>
+ <fileDesc>
+ <titleStmt>
+ <title>xmltex</title>
+ </titleStmt>
+ <publicationStmt>
+ <availability>
+ <p>
+ This file is distributed under the LaTeX Project Public License
+ (LPPL) as found at <xptr doc="lppl"/>.
+ Either version 1.0, or at your option, any later version.
+ </p>
+ </availability>
+ </publicationStmt>
+ <sourceDesc>
+ <p></p>
+ </sourceDesc>
+ </fileDesc>
+ <profileDesc>
+ </profileDesc>
+ <revisionDesc>
+ <list>
+ <head></head>
+ <item><date>February 2nd 2000</date>
+ <name>David Carlisle</name>Updated)</item>
+ <item><date>January 24th 2000</date>
+ <name>David Carlisle</name>Updated)</item>
+ <item><date>January 19th 2000</date>
+ <name>David Carlisle</name>Updated)</item>
+ <item><date>January 18th 2000</date>
+ <name>David Carlisle</name>Updated)</item>
+ <item><date>January 15th 2000</date>
+ <name>David Carlisle</name>Updated)</item>
+ <item><date>January 10th 2000</date>
+ <name>Sebastian Rahtz</name>corrections</item>
+ <item><date>January 10th 2000</date>
+ <name>David Carlisle</name>Updated (in XML)</item>
+ <item><date>January 6th 2000</date>
+ <name>Sebastian Rahtz</name>Converted to TEI XML</item>
+ <item><date>January 6th 2000</date>
+ <name>David Carlisle</name>written in LaTeX</item>
+ </list>
+ </revisionDesc>
+ </teiHeader>
+ <text>
+<front>
+ <docTitle>
+ <titlePart type="main">xmltex: A non validating (and not 100%
+ conforming) namespace aware XML parser implemented in &TeX;</titlePart>
+ </docTitle>
+ <docDate>Date: 2000-02-02</docDate>
+ <docAuthor rend="email">davidc@nag.co.uk</docAuthor>
+ <docAuthor>David Carlisle</docAuthor>
+</front>
+<body>
+<div id="intro">
+<head>Introduction</head>
+<p>
+xmltex implements
+a non validating parser for documents matching the
+W3C XML Namespaces Recommendation.
+
+
+The system may just be used to parse the file (expanding entity
+references and normalising namespace declarations) in which case it
+records a trace of the parse on the terminal. Normally however the
+information from the parse is used to trigger &TeX; typesetting code.
+Declarations (in &TeX; syntax) are provided as part of xmltex to
+associate &TeX; code with the start and end of each XML element,
+attributes, processing instructions, and with unicode character data.
+</p>
+</div>
+
+<div>
+<head>Installation</head>
+<p>The xmltex parser itself does not require &LaTeX;. It may be loaded
+into initex to produce a format capable of parsing XML files. However
+such a format would have no convenient commands for typesetting, and
+so normally xmltex will be used on top of an existing format, normally
+&LaTeX;. In this section we assume that the document to be
+processed is called <code>document.xml</code>.
+</p>
+<div>
+<head>Using xmltex as an input to the &LaTeX; command</head>
+<p>&LaTeX; requires a document in &TeX; syntax, not XML. To process
+<code>document.xml</code>, first produce a two line file called
+<code>document.tex</code> of the following form:
+<eg>
+\def\xmlfile{document.xml}
+\input xmltex.tex
+</eg>
+
+Do <emph>not</emph> put any other commands in this file!</p>
+<p>You may then process the document with either of the commands:
+<code>latex document</code> or <code>latex document.tex</code>
+or the equivalent procedure in your &TeX; environment.
+</p>
+</div>
+<div>
+<head>Using xmltex as a &TeX; format built on &LaTeX;</head>
+<p>
+You may prefer to set up xmltex as a format in its own right.
+This may speed things up slightly (as <code>xmltex.tex</code> does not
+have to be read each time) but more importantly perhaps it allows the
+XML file to be processed directly without needing to make the
+<code>.tex</code> wrapper.</p>
+<p>To make a format you will need a command such as the following,
+depending on your &TeX; system.
+<eg>
+initex &amp;latex xmltex
+initex \&amp;latex xmltex
+tex -ini &amp;latex xmltex
+tex -ini \&amp;latex xmltex
+</eg></p>
+<p>This will produce a format file <code>xmltex.fmt</code>. You should then
+be able to make a <code>xmltex</code> command by copying the way the
+<code>latex</code> command is defined in terms of
+<code>latex.fmt</code>. Depending on the &TeX; system, this might be a
+symbolic link, or a shell script, or batch file, or a configuration
+option in a setup menu.
+
+</p>
+</div>
+<div>
+<head> Making an xmltex format `from scratch'</head>
+<p>
+Whilst it may be convenient to build an xmltex format as above, starting
+from the &LaTeX; format. You may prefer to instead work with an initex
+with no existing format file. Even if you wish to use a standard &LaTeX;
+it may be preferable to make a &TeX; input file that first inputs
+<code>latex.ltx</code> then <code>xmltex.tex</code>. In particular this
+will allow you to have a different hyphenation and language
+customisation for xmltex than for &LaTeX;. Many of the features of
+the language support in &LaTeX; are related to modifying the input
+syntax to be more convenient. Such changes are not needed in xmltex as
+the input syntax is always XML. Some language files may change the
+meaning of such characters as &lt; which would break the xmltex parser.
+Also, rather than using <code>latex.ltx</code> you could in principle
+use a modified <code>docstrip</code> install file and produce a
+`cut down' latex that did not have features that are not going to be
+used in xmltex.
+</p>
+<p>
+Unfortunately the support for this method of building xmltex (and access
+to non English hyphenation generally) is not fully designed and totally
+undocumented.</p>
+</div>
+</div>
+<div>
+<head>Using xmltex</head>
+<p>
+xmltex by default `knows' nothing about any particular type of XML
+file, and so needs to load external files containing specific
+information. This section describes how the information in the XML
+file determines which files will be loaded.
+
+<list type="ordered">
+<item> If the file begins with a Byte Order Mark, the default encoding
+ is set to utf-16. Otherwise the default encoding is utf-8.
+</item>
+<item> If (after an optional BOM) the document begins with an XML
+ declaration that specifies an encoding, this encoding will be used,
+ otherwise the default encoding will be used. A file with name of the
+ form <emph>encoding</emph><code>.xmt</code> will be loaded that maps the
+ requested encoding to Unicode positions. (It is an error if this
+ file does not exist for the requested encoding.)
+</item>
+<item> If the document has a <code>DOCTYPE</code> declaration that includes
+ a local subset then this will be parsed. If any external DTD entity
+ is referenced (by declaring and then referencing a parameter entity)
+ then the SYSTEM and PUBLIC identifiers of this entity will be looked
+ up in a catalogue (to be described below). If either identifier is
+ known in the catalogue the corresponding xmltex package (often with
+ <code>.xmt</code> extension) will be loaded.
+</item>
+<item> After any local subset has been processed, if the DOCTYPE
+ specifies an external entity, the PUBLIC and/or SYSTEM identifiers
+ of the external dtd file will be similarly looked up, and a
+ corresponding xmltex file loaded if known.
+</item>
+<item> As each element is processed, it may be `known' to xmltex by
+ virtue of one of the packages loaded, or it may be unknown. If it is
+ unknown then if it is in a declared namespace, the namespace URI
+ (not the prefix) is looked up in the xmltex catalogue. If the
+ catalogue specifies an xmltex package for this namespace it will be
+ loaded. If the element is not in a namespace, then the element name
+ will be looked up in the catalogue.
+</item>
+<item> If after all these steps the element is still unknown then
+ depending on the configuration setting either a warning or an error
+ will be displayed. (Currently only warning implemented.)
+</item>
+</list>
+</p>
+<div><head>The xmltex Catalogue</head>
+<p>As discussed above, xmltex requires a mapping between PUBLIC and
+SYSTEM identifiers, namespace URI, and element names, to files of
+&TeX; code. This mapping is implemented by the following commands:
+<eg>
+<code>\NAMESPACE</code>{<emph>URI</emph>}{<emph>xmt-file</emph>}
+<code>\PUBLIC</code>{<emph>FPI</emph>}{<emph>file</emph>}
+<code>\SYSTEM</code>{<emph>URI</emph>}{<emph>file</emph>}
+<code>\NAME</code>{<emph>element-name</emph>}{<emph>xmt-file</emph>}
+<code>\XMLNS</code>{<emph>element-name</emph>}{<emph>URI</emph>}
+</eg>
+As described above, if the first argument of one of these commands
+matches the string specified in the XML source file, the corresponding
+&TeX; commands in the file specified in the second argument are
+loaded. The PUBLIC and SYSTEM catalogue entries may also be used
+to control which XML files should be input in response to external
+entity references. The <code>\XMLNS</code> is rather different,
+if an element in the null namespace does not have any definition
+attatched to it, this declaration forces the default namespace to the
+given URI. The catalogue lookup is then repeated. This allows for
+example documents beginning <code>&lt;html&gt;</code> to be coerced into
+the xhtml namespace.</p>
+<p>These commands may be placed in a configuration file, either
+<code>xmltex.cfg</code>, in which case they apply to all documents,
+or in a configuration file `<code>\jobname.cfg</code>' (eg
+<code>document.cfg</code> in the example in the Introduction) in which
+case the commands just apply to the specified document.
+</p>
+</div>
+
+<div>
+<head>Configuring xmltex</head>
+<p>In addition to the `catalogue' commands described earlier there are
+other commands that may be placed in the configuration files.
+
+<list type="unordered">
+<item> <p><code>\xmltraceonly</code></p>
+<p> This stops xml from trying to typeset the
+ document. The external files specified in the catalogue are still
+ loaded, so that the trace may report any elements for which no code
+ is defined, but no actual typesetting takes place. In the event of
+ unknown errors it is always worth using xmltex in this mode to
+ isolate any problems.</p>
+<p>It may be noted that if an xmltex format is built just using initex
+without any typesetting commands, the resulting format should still
+be able to parse any XML file if xmltex.cfg just specifies
+<code>\xmltraceonly</code> and \jobname.cfg is empty.</p>
+</item>
+<item> <p><code>\xmltraceoff</code></p>
+<p>By default xmltex provides a trace of its XML parse, displaying
+ each element begin and end. This command used in xmltex.cfg or
+ `\jobname.cfg' will stop this trace being produced.</p>
+</item>
+
+<item><p> <code>\inputonce</code>{<emph>xmt-file</emph>}</p>
+<p>The catalogue entries specify that
+ certain files should be loaded if XML constructs are met.
+ Alternatively the files may just always be loaded. The system will
+ ignore any later requests to load. This is especially useful if an
+ xmltex format is being made.</p>
+</item>
+<item><p><code>\UnicodeCharacter</code>{<emph>hex-or-dec</emph>}{<emph>tex-code</emph>}</p>
+<p>The first argument specifies a unicode character number, in the same
+format as used for XML character entities, namely either a decimal
+number, or an upper case Hex number preceded by a lower case
+`<code>x</code>'.</p>
+<p>The second argument specifies arbitrary &TeX; code to be used when
+typesetting this character. Any code in the XML
+range may be specified (ie up to x10FFFF). Although codes in the
+`ASCII' range, below 128, may be specified, the definitions supplied
+for such characters will not be default be used. The definition will
+howeverbe stored and used if the character is activated using the
+command described below.</p>
+</item>
+<item> <p><code>\ActivateASCII</code>{<emph>hex-or-dec</emph>}</p>
+<p>The argument to this command should be a number less than 128.
+If a character us activated by this command in a configuration file
+then any special typesetting instructions specified for the character
+will be executed whenever the character appears as character data.</p>
+<p>Some ASCII characters are activated by default. The list is
+essentially those characters with special meanings to either &TeX; or
+XML.</p>
+</item>
+
+</list>
+</p>
+<p>
+If a format is being made, there are essentially two copies of
+<code>xmltex.cfg</code> that may play a role. The configuration file
+input when the format is made will control catalogue entries and
+packages built into the format. A possibly different
+<code>xmltex.cfg</code> may be used in the input path of `normal' &TeX;,
+this will then be used for additional information loaded each run.</p>
+<p>In either case, a separate configuration file specific to the given
+XML document may also be used (which is loaded immediately after
+<code>xmltex.cfg</code>).
+</p>
+</div>
+</div>
+
+<div id="stopping">
+<head>Stopping xmltex</head>
+<p>xmltex should stop after the end of the document
+element has been processed. If things go wrong and
+you end up at the interactive
+<code>*</code> prompt you might want to exit with
+<code><![CDATA[<?xmltex \stop?>]]></code>).
+</p>
+</div>
+
+<div>
+<head>xmltex package files</head>
+<p>
+xmltex package files are the link between the XML markup and &TeX;
+typesetting code. They are written in &TeX; (rather than XML) syntax
+and may load directly or indirectly other files, including &LaTeX;
+class and package files. For example a file loaded for a particular
+document type may directly execute <code>\LoadClass{article}</code>, or
+alternatively it may cause some XML element in the document to
+execute <code>\documentclass{article}</code>. In either case the document will
+suffer the dubious benefit of being formatted based on the style
+implemented in <code>article.cls</code>. Beware though that the package
+files may be loaded at strange times, the first time a given namespace
+is declared in a document, and so the code should be written to work
+if loaded inside a local group.</p>
+<p>Characters in xmltex package files have their normal &LaTeX; meanings
+except that line endings are ignored so that you do not need to add
+a % to the end of lines in macro code. Unlike fd file conventions, other
+white space is <emph>not</emph> ignored.</p>
+<p>The available commands are:
+
+<list type="unordered">
+<item><p><code>\FileEncoding</code>{<emph>encoding</emph>}</p>
+<p>This is the analogue for &TeX; syntax files of the encoding specification
+in the XML or text declaration of XML files. If it is not specified the
+file will be assumed to be in UTF-8.</p>
+</item>
+
+<item><p><code>\DeclareNamespace</code>{<emph>prefix</emph>}{<emph>URI</emph>}</p>
+<p>This declares a prefix to be used <emph>in this file</emph> for referring to
+elements in the specified namespace. If the prefix is empty then this
+declares the default namespace (otherwise, unprefixed element names
+refer to elements that are not in a namespace).</p>
+<p>Note that the elements in the XML document instance may use a
+different prefix, or no prefix at all to access this namespace.
+In order to resolve these different prefixes for the same namespace,
+each time a namespace is encountered for the first time (either
+by <code>\DeclareNamespace</code> in a preloaded package, or in a namespace
+declaration in the XML instance) then it is allocated a new number
+and any further namespace declaration for the same URI just locally
+associates a prefix with this number. It is these numbers that are
+displayed when the XML trace of the parse of the document is shown,
+and also if any element is written out to an external file it will
+have a normalised prefix of a number whichever prefix it had
+originally. (Numeric prefixes are not legal XML, but this is an
+advantage, it ensures these internal forms can not clash with any
+prefix actually used in the document.)</p>
+<p>Three namespaces are predeclared. The null namespace (0), the XML
+namespace (<code>http://www.w3.org/1998/xml</code>) (1) which is predeclaed
+with prefix <code>xml</code> as specified in the Namespace Recommendation,
+and the xmltex namespace
+(<code>http://www.dcarlisle.demon.co.uk/xmltex</code>) (2) which is not
+given a default prefix, but may be used to have XML syntax for some
+internal commands (eg to have .aux files fully in XML, currently they
+are a hybrid mixture of some &TeX; and some XML syntax).
+</p>
+</item>
+<item><p>
+ <code>\XMLelement</code>{<emph>element-qname</emph>}{<emph>attribute-spec</emph>}
+{<emph>begin-code</emph>}{<emph>end-code</emph>}</p>
+<p> This is similar to a &LaTeX; <code>\newenvironment</code> command.</p>
+<p> Declare the code to execute at the start and end of each instance of
+this element type. This code will be executed in a local group (like a
+&LaTeX; environment). The second argument declares a list of attributes
+and their default values using the <code>\XMLattribute</code> command
+described below.
+</p>
+</item>
+<item><p>
+ <code>\XMLelement</code>{<emph>element-qname</emph>}
+{<emph>attribute-spec</emph>}
+<code>{\xmlgrab}</code>{<emph>end-code</emph>}</p>
+<p> A special case of the above command (which may be better made into a
+ separate declaration) is to make the <emph>start-code</emph> just be the command
+ <code>\xmlgrab</code>. In this case the <emph>end-code</emph> has access to the
+ element content (in XML syntax) as <code>#1</code>. This content isn't
+ literally the same as the original document, namespaces, white space
+ and attribute quote symbols will all have been normalised.
+</p>
+</item>
+<item> <p>
+ <code>\XMLattribute</code>{<emph>attribute-qname</emph>}
+{<emph>command-name</emph>}{<emph>default</emph>}</p>
+<p>This command may only be used in the argument to
+<code>\XMLelement</code>.
+ The first argument specifies the name of an attribute (using any
+ namespace prefixes current for this package file, which need not
+ be the same as the prefixes used in the document).
+ The second argument gives a &TeX; command name that will be used to
+ access the value of this attribute in the begin and end code for the
+ element. (Note using &TeX; syntax here provides a name independednt of
+ the namespace declarations that are in scope when this code is executed).
+ The third argument provides a default value that wil be used if the
+attribute is not used on an instance of this element.
+ </p>
+<p>The special token <code>\inherit</code> may be used which will cause
+the command to have a value set in an ancestor element if this element
+does not specify any value.</p>
+<p>If a &TeX; token such as <code>\relax</code> is used as the default
+the element code may distinguish the case that the attribute is not used
+in the document.</p>
+</item>
+<item> <p>
+ <code>\XMLnamespaceattribute</code>
+{<emph>prefix</emph>}{<emph>attribute-qname</emph>}
+{<emph>command-name</emph>}{<emph>default</emph>}</p>
+<p>This command is similar to <code>\XMLattribute</code>
+ but is used at the top level of the package file, not in the argument
+to <code>\XMLelement</code>. It is equivalent to specifying the
+attribute in <emph>every</emph> element in the namespace specified by
+the first argument. As usual the prefix (which may be {} to denote the
+default namespace) refers to the namespace declarations in the xmltex
+package: the prefixes used in the document may be different.</p>
+</item>
+
+<item><p><code>\XMLentity</code>{<emph>name</emph>}{<emph>code</emph>}</p>
+<p>Declare an (internal parsed) entity, this is equivalent to a
+<code><![CDATA[<!ENTITY]]></code> declaration, except that the
+replacement text is specified in &TeX; syntax.</p>
+</item>
+
+<item><p><code>\XMLname</code>{<emph>name</emph>}{<emph>command-name</emph>}</p>
+<p>Declare the &TeX; command to hold the (normalised, internal form) of
+the XML name given in the first argument. This allows the code specified in
+<code>\XMLelement</code> to refer to XML element names without knowing
+the encodings or namespace prefixes used in the document. Of particular
+use might be to compare such a name with <code>\ifx\XML@parent</code>
+which will allow element code to take different actions depending on
+the parent of the current element.</p>
+</item>
+
+
+<item><p><code>\XMLstring</code>{<emph>command-name</emph>}&lt;&gt;<emph>XML Data</emph>&lt;/&gt;</p>
+<p>This saves the XML fragment as the &TeX; command given in the first
+argument. It may be particularly useful for redefining `fixed strings'
+that are generated by &LaTeX; document classes to use any special
+typesetting rules specified for individual characters.</p>
+<p>It should also be used for defining any strings used to
+in comparison tests with strings occurring in the XML document.
+Using <code>\XMLstring</code> rather than <code>\def</code> ensures
+that the characters and encodings in the string are correctly normalised.</p>
+</item>
+
+
+</list>
+
+</p>
+</div>
+<div>
+<head>XML processing</head>
+<p>
+xmltex tries as far as possible to be a fully conforming non
+validating parser. It fails in the following respects.
+<list type="unordered">
+<item> Error reporting is virtually non existent. Names are not checked
+ against the list of allowed characters, and various other
+ constraints are not enforced.
+</item>
+<item><p> A non validating parser is not forced to read external dtd
+ entities (and this one does not) It is obliged to read the local
+ subset and process entity definitions and attribute declarations.
+ Entity declarations are reasonably well handled: External parameter
+ entities are handled as above, loading a corresponding xmltex file
+ if known. External entities are similarly processed, inputting
+ the XML file, a difference in this case is that if the entity is not
+ found in the catalogue, the SYSTEM identifier will be used directly
+ to <code>\input</code> as often this is a local file reference. Internal
+ parsed entities and parameter entities are essentially treated as
+ &TeX; macros, and nonparsed entities are saved along with their
+ NDATA type, for use presumably by <code>\includegraphics</code>.</p>
+<p>Attribute defaults are processed in the local subset of the dtd, however
+ note that this is `namespace unaware' defaulting and only applies to
+ elements using the same prefix and local name, unlike the defaulting
+ done by <code>\XMLattribute</code>. </p>
+</item>
+<item><p> Support for encodings depends on having an encoding mapping
+ file. Any 8bit encoding that matches Unicode for the first 127 positions
+ may be used by making a trivial mapping file. (The one for latin1
+ looks over complicated as it programs a loop rather than having 127
+ declarations saying that latin1 and Unicode are identical in this
+ range).</p>
+<p> UTF-8 is supported, but support for UTF-16 is minimal. Currently
+ only latin-1 values work: (In this range UTF-16 is just latin-1 with
+ a null byte inserted after (or before, depending on endedness)
+ each latin-1 byte. The UTF-16 implementation just ignores this null
+ byte then processes as for latin-1. Probably the first few 8bit
+ pages could be similarly supported by making the low ascii control
+ characters activate UTF-16 processing but this will never be
+ satisfactory using a standard &TeX;. Hopefully a setup for a 16bit
+ &TeX; such as Omega will correct this.</p>
+</item>
+</list>
+
+</p>
+</div>
+<div>
+<head>Accessing &TeX;</head>
+<p>In theory you should be able to control the document just be suitable
+code specified by <code>\XMLelement</code> and friends, but sometimes it may be
+necessary to `tweak' the output by placing commands directly in the
+source.</p>
+<p>Two mechanisms are availalable to do this.
+<list type="unordered">
+<item><p> Using the xmltex namespace. The xmltex namespace conatins a
+ small (currently empty) set of useful &TeX; constructs that are
+ accessed by XML syntax. For example if xmltex provides a mechanism
+ for having XML (rather than &LaTeX;) syntax toc files, it will need
+ an analogue of <code>\contentsline</code> which might be an element
+ accessed by <gi>xmltex:contentsline</gi>&ldots; where the xmltex
+ prefix is declared on this or a parent element to be
+ <code>xmlns:xmltex="http://www.dcarlisle.demon.co.uk/xmltex"</code>.</p>
+<p> As the xmltex namespace is declared but currently empty, a more
+ useful variant of this might be:</p>
+</item>
+<item> Declare your own namespace for &TeX; tweaks, and load a suitable
+ package file that attatches &TeX; code to the elements in this
+ namespace (or at least specify the correspondence between the
+ namespace and the package using <code>\NAMESPACE</code>).
+ For instance if you put <gi>clearpage xmlns="/my/tex/tweak"/</gi>
+ in your document, this will force a page break if you have at
+ suitable points, <code>\NAMESPACE{/my/tex/tweak}{tweak.xmt}</code>
+ and
+<eg>
+\DeclareNamespace{tweak}{"/my/tex/tweak"}
+\XMLelement{tweak:clearpage}{\clearpage}
+</eg>
+</item>
+<item><p> A second different mechanism is available, to use XML processing
+ instructions. A Processing Instruction of the form:
+<gi>?xmltex</gi> <emph>&TeX; commands</emph> <code>?></code>
+will execute the &TeX; commands.</p>
+</item>
+</list>
+
+</p>
+</div>
+
+<div>
+<head>Bugs</head>
+<p>None, of course.</p>
+</div>
+
+<div>
+<head>Don't Read Past This Point</head>
+<p>Thus section discusses some of the more experimental features of xmltex
+that may get a cleaner syntax (or be removed, as a bad idea) in later releases,
+and also describes some of the internal interfaces (which are also
+subject to change)</p>
+
+<div>
+<head>Input Encodings and States</head>
+<p>At any point while processing a document, xmltex is in one of two
+<emph>states</emph>: <emph>tex</emph> or <emph>xml</emph>.</p>
+<div><head>States</head>
+<p>In the xml <emph>state</emph>,
+ &lt; and &amp; are the only two characters that
+trigger special markup codes. Other characters, such as !, &gt;, =,
+&ldots; may be used in certain XML constructs as markup but unless
+some code has been triggered by &lt; they are treated simply as
+character data. All characters above 127 are `active' to &TeX;
+and are used to translate the input encoding to UTF-8. All internal
+character handling is based on UTF-8, as described below. Some
+characters in the ASCII range, below 127 are also active by default
+(mainly punctuation characters used in XML constructs, such as
+the ones listed above). Some or all of the others may be activated
+using the <code>\ActivateASCII</code> command, which allows special
+typesetting rules to be activated for the characters, at some cost in
+processing speed.</p>
+<p>In the tex <emph>state</emph>,
+characters in the ASCII range have their usual
+&TeX; meanings, so letters are `catcode 11' and may be used in &TeX;
+control sequences, \ is the escape character, &amp; the table cell
+separator, etc. Characters above 127 have the meanings current for the
+current encoding just as for the xml state, probably this means that
+they are unusable in &TeX; code, except for the special case of
+referring to XML element names in the first argument to
+<code>\XMLelement</code> and releated commands.</p>
+</div>
+<div><head>Encodings</head>
+<p>Whenever a new (XML or &TeX;) file is input by the xmltex system the
+<emph>encoding</emph> is first switched to UTF-8. At the end of the
+input the encoding is returned to whatever was the current encoding.
+The encoding current while the file is read is determined by the
+encoding pseudo-attribute on the XML or text declaration in the case
+of XML files, or by the <code>\FileEncoding</code> command for &TeX;
+files. Note that the encoding mechanism <emph>only</emph> is triggered
+by xmltex file includes. Once an xmltex package file is loaded it may
+include other &TeX; files by <code>\input</code> or
+<code>\includepackage</code> these input command swill be transparent
+to the xmltex encoding system. The vast majority of &TeX; macro
+packages only use ASCII characters so this should not be a
+problem.</p>
+<p>Note that if the <code>\includepackage</code> occurs directly in
+the xmltex package file, the &TeX; code will be included with a known
+encoding, the one specified in the xmltex package, or UTF-8. If
+however the <code>\includepackage</code> is included in code specified
+by <code>\XMLelement</code>, then it will be executed with whatever
+encoding is current in the document at the point that element is
+reached. Before xmltex executes the code for that element it will
+switch to the tex state, thus normalising the ascii characters
+but characters above 127 will not have predefined definitions in this
+case.</p>
+<p>Internally eveything is stored as UTF-8. So `aux' and `toc' files
+will be in UTF-8 even if the document (or parts of the document) used
+different encodings.</p>
+<p>To specify a new encoding, if it is an 8 bit encoding that matches
+ASCII in the printable ASCII range, then one just needs to produce a
+file with name <emph>encoding</emph><code>.xmt</code> (in lowercase,
+on case sensitive systems) this should consist of a series of
+<code>\InputCharacter</code> commands, giving the input character slot
+and the equivalent Unicode. If an encoding is specified in this manner
+character data will be converted to UTF-8 by <emph>expansion</emph>
+and so ligatures and inter letter kerns will be preserved. (Conversely
+if characers are accessed by character references, &amp;#1234; then
+&TeX; arithmetic is used to decode the information and ligature
+information will be lost. For some large character sets, especially
+for Asian languages, these mechanisms will probably not prove to be
+sufficient, some mechanisms are being investigated, but in the short
+term it may be necessary to always use UTF-8 if the input encoding
+is not strictly a ine byte extension of the ASCII code page.
+</p></div>
+
+</div>
+
+<div>
+<head>xmltex Package Commands</head>
+<p>You can use arbitrary &TeX; commands in an xmltex package,
+althought you should be aware that the file may be input into a local
+group, at the point in a document that a particular namespace is first
+used, for example. There are however some specific commands designed
+to be used in the begin or end code of <code>\XMLElement</code>.
+<list type="unordered">
+
+<item><p><code>\ignorespaces</code></p>
+<p>This is actually a &TeX; primitive
+(for the moment!)</p>
+</item>
+
+<item><p><code>\obeyspaces</code></p>
+<p>Obey consecutive space characters,
+rather than treating consecutive runs as a single space.
+(A command of this name, but not this definition is in plain &TeX;.)</p>
+</item>
+
+<item><p><code>\obeylines</code></p>
+<p>Obey end of line characters,
+rather than treating then as a space, force a line break.
+(A command of this name, but not this definition is in plain &TeX;.)</p>
+</item>
+
+<item><p><code>\xmltexfirstchild#1\@</code></p>
+<p>If the <emph>start-code</emph> for an element is specified as
+<code>\xmlgrab</code> then the <emph>end-code</emph> may use
+<code>#1</code> in order to execute the element content. Sometimes you
+do not want all of the content. The a construction (with currently
+unpleasant syntax) <code>\xmltexfirstchild#1\@</code> will just evaluate
+the first child element of the content, discarding the remaining
+elements.</p>
+</item>
+
+<item><p><code>\xmltextwochildren\csa\csb#1</code></p>
+<p>If you know that the content will be exactly two child elements (for
+examle a MathML frac or sub element) then this command may be used.
+It will execute the &TeX; code
+<code>\csa{</code><emph>child-1</emph><code>}\csb{</code><emph>child-2</emph>
+So either two &TeX; command smay be supplied, one will be applied to
+each child, or the second argument may be <code>{}</code> in which case
+the first argument may be a &TeX; command that takes two arguments.
+For example the code for MathMl frac might be
+<eg>
+\XMLelement{m:mfrac}
+ {}
+ {\xmlgrab}
+ {\xmltextwochildren\frac{}#1}
+</eg>
+</p>
+</item>
+
+<item><p><code>\xmltexthreechildren\csa\csb\csc#1</code></p>
+<p>As above, but more so.</p></item>
+
+<item><p><code>\xmltexforall\csa{#1}</code></p>
+<p>The &TeX; command <code>\csa</code> is called repeatedly,
+taking each child element of the current element as argument
+on each iteration. As a convenience the command <code>\xml@name</code>
+is defined before each iteration to have the (internal, normalised)
+name of the element being processed.</p>
+</item>
+
+<item><p><code>\NDATAEntity\csa\csb\attvalue</code></p>
+<p>If the XML parser encounters an internalor external entity reference
+it expands it without executing any special hook that may be defined in
+an xmltex package. However NDATA entites are never directly encountered
+in an entity reference. They may only be used as an attribute value.
+If <code>\attvalue</code>. is a &TeX; command holding the value of an
+attribute, as declared in <code>\XMLattribute</code> then
+<code>\NDATAEntity\csa\csb\attvalue</code> applies the two &TeX;
+commands <code>\csa</code> and <code>\csb</code> to the notation type
+and the value, in a way exactly corresponding to
+<code>\xmltextwochildren</code> so for example the XML document for this
+manual specifies
+<eg><![CDATA[
+ <!NOTATION URL SYSTEM "" >
+ <!ENTITY lppl SYSTEM "http://www.latex-project.org/lppl.txt" NDATA URL>]]>
+</eg>
+and this is handled by the following xmltex code
+<eg><![CDATA[
+\XMLelement{xptr}
+ {\XMLattribute{doc}{\xptrdoc}{}}
+ {\NDATAEntity\xptrdoc\@gobble\url}
+ {}]]>
+</eg>
+which saves the attribute value in <code>\xptrdoc</code> and then
+discards the notation name (URL) and applies the command
+<code>\url</code> to typeset the supplied URL.
+</p>
+</item>
+
+</list>
+</p>
+
+</div>
+
+<div>
+<head>Character Data Internals</head>
+<p>
+<table>
+<row>
+<cell/> <cell>int.</cell><cell>ext. xml</cell>
+<cell>ext. mixed</cell><cell>csn typeout</cell>
+<cell/>
+</row>
+<row>
+<cell>d</cell><cell>xabc</cell><cell>xabc</cell>
+<cell>xabc (12)</cell><cell>xabc (12)</cell><cell>xabc (12)</cell>
+<cell/>
+</row>
+<row>
+<cell>c</cell><cell>xab</cell><cell>xab</cell>
+<cell>xab (12)</cell><cell>xab (12)</cell><cell>xab (12)</cell>
+<cell/>
+</row>
+<row>
+<cell>b</cell><cell>xa</cell><cell>xa</cell>
+<cell>xa (12)</cell><cell>xa (12)</cell><cell>xa (12)</cell>
+<cell/>
+</row>
+<row>
+<cell>ax</cell><cell>x</cell><cell>x</cell>
+<cell>x</cell><cell>x</cell><cell>x (12)</cell>
+<cell>(!)</cell>
+</row>
+<row>
+<cell>ay</cell><cell>x</cell><cell>x</cell>
+<cell>x</cell><cell>&amp;#123;</cell><cell>x (12)</cell>
+<cell>(e)</cell>
+</row>
+<row>
+<cell>az</cell><cell>x</cell><cell>\az x</cell>
+<cell>&amp;#123;</cell><cell>&amp;#123;</cell><cell>x (12)</cell>
+<cell>(&amp;lt;)</cell>
+</row>
+<row>
+<cell>&lt;</cell><cell>&lt;</cell><cell>&lt;</cell>
+<cell>&lt;</cell><cell>&lt;</cell><cell>&lt; (12)</cell>
+<cell>(&lt;)</cell>
+</row>
+</table>
+
+</p>
+</div>
+
+
+</div>
+
+
+</body>
+</text>
+</TEI.2>
+
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/manual.xsl b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.xsl
new file mode 100644
index 00000000000..0bf8a7234ed
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/manual.xsl
@@ -0,0 +1,29 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+version="1.0">
+<xsl:import href="http://www.oucs.ox.ac.uk/stylesheets/teihtml.xsl"/>
+<xsl:variable name="subTocDepth">-2</xsl:variable>
+<xsl:variable name="masterFile">manual</xsl:variable>
+<xsl:variable name="splitLevel">-1</xsl:variable>
+<xsl:variable name="alignNavigationPanel">center</xsl:variable>
+<xsl:variable name="topNavigationPanel"></xsl:variable>
+<xsl:variable name="bottomNavigationPanel">true</xsl:variable>
+<xsl:variable name="institution">Numerical Algorithms Group: NAG</xsl:variable>
+<xsl:variable name="homeURL">http://www.nag.co.uk/</xsl:variable>
+<xsl:variable name="homeWords">NAG</xsl:variable>
+<xsl:variable name="parentURL">http://www.tei-c.org/</xsl:variable>
+<xsl:variable name="parentWords">NAG</xsl:variable>
+<xsl:variable name="feedbackURL">http://www.nag.co.uk/</xsl:variable>
+<xsl:variable name="feedbackWords">NAG</xsl:variable>
+<xsl:variable name="searchURL"></xsl:variable>
+<xsl:variable name="searchWords"></xsl:variable>
+<xsl:variable name="showTitleAuthor">true</xsl:variable>
+<xsl:template name="logoPicture"/>
+<xsl:template name="copyrightStatement"> Copyright 2000 David Carlisle, NAG
+
+</xsl:template>
+
+
+
+</xsl:stylesheet>
+
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/portugeselatin1.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/portugeselatin1.xml
new file mode 100644
index 00000000000..a13fb0b4f3e
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/portugeselatin1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<documento att="portugus">
+ <seco>
+ <cabealho>Teste</cabealho>
+ Ol Mundo!
+ </seco>
+</documento>
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/readme.txt b/Master/texmf-dist/doc/otherformats/xmltex/base/readme.txt
new file mode 100644
index 00000000000..fb2ddfcc088
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/readme.txt
@@ -0,0 +1,123 @@
+
+ xmltex.tex
+ ==========
+
+Copyright 2000 David Carlisle
+
+This collection of files is distributed under the LaTeX Project Public
+License a (LPPL) as found at http://www.latex-project.org/lppl.txt
+Either version 1.0, or at your option, any later version.
+
+
+xmltex is a system for typesetting XML files with TeX. It may be used
+on its own or in conjunction with another TeX format. (LaTeX is
+assumed for most examples).
+
+xmltex supports the XML Namespace Recommendation. Arbitrary prefixes
+may be used in document instances, and in definition files. It
+supports any encoding that matches ASCII in the first 127 positions.
+UTF-8, latin-1 and KOI8-R are included in the distribution, other
+encodings may be trivially added.
+
+Further documentation may be obtained by running manual.tex through
+LaTeX.
+
+The distribution of 2000-01-18 consists of:
+
+* readme.txt
+ This file.
+
+
+
+* xmltex.tex
+ The source code for xmltex.
+
+* xmltex.cfg
+ Configuration file for xmltex, with sufficient information about
+ Unicode to typeset the latin-1 and Cyrillic examples in the
+ distribution, and information about the namespaces and dtd used in the
+ examples.
+
+* iso-8859-1.xmt
+ internal file defining latin-1 input encoding
+
+* utf-16.xmt
+ place holder for a file supporting UTF-16 (not really possible with
+ standard TeX).
+
+* koi8-r.xmt
+ internal file defining the Cyrillic encoding KOI8-R.
+ Support for any 8 bit encoding that matches ASCII for the first 127
+ positions may be added by copying the format of file.
+
+
+
+* manual.xml
+ The manual for xmltex (marked up in TEI XML).
+
+* manual.tex
+ Support files for processing the manual.
+ LaTeX manual.tex with your standard LaTeX format, to obtain
+ the typeset documentation.
+
+* manual.html manual.xsl
+ HTML version of manual, generated via XSL (thanks to Sebastian Rahtz).
+
+
+* tei.xmt
+ xmltex package file for TEI XML markup as used in the xmltex manual.
+ (The much of this file was implemented by Sebastian Rahtz)
+
+* mathml2.xmt
+ A small start towards an xmltex package for MathML2.
+ Used in one of the test files.
+
+* sec.xmt
+ A package for a small XML document language used in sone of the test
+ files.
+
+
+
+* langtest.xml langtest.tex
+ This test example file demonstrates a small `hello world' document in
+ different languages and different encodings all input into the same
+ document. Note that the table of contents is constructed correctly
+ despite the fact taht different encodings are used. Also note that
+ typesetting commands only need to be defined once, irrespective of
+ encoding. So the Cyrillic command for `document' looks quite different
+ in the utf-8 and koi8-r files, but the same definitions work in both
+ cases.
+
+* englishutf8.xml
+ English markup in utf-8, used by langtest.xml
+
+* English markup in utf-16, used by langtest.xml.
+ Note that utf-16 support is limited to the latin-1 range (it just
+ consists of ignoring the null byte).
+
+* portugeselatin1.xml
+ Portugese example, note that the markup is in latin 1, but the
+ definitions (in langtest.cfg are in utf-8).
+
+* russiankoi8.xml
+ Russian Example, KOI8-R. This test file typesets Cyrillic letters
+ This assumes the AMS `OT2' encoded cyrillic fonts are present on your
+ system. (Better support for cyrillic is available with the T2 encoded
+ fonts but these are not used in this example to enable the example
+ to be run on as many sites as possible.)
+
+* russiankutf8.xml
+ Russian Example, utf-8.
+
+
+* testsec.xml testsec.tex
+ A small example testing varius features.
+ The final section includes some tests of MathML.
+ Note that the elements defined in this file use a namespace prefix
+ even though the elements in the XML document (testsec) do not.
+
+* testascii.xml testascii.tex testascii.cfg
+ A test file in which all characters are activated, allowing for some
+ special effects. (Here vowels are red and numbers are old style.)
+
+ \ No newline at end of file
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/russiankoi8.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/russiankoi8.xml
new file mode 100644
index 00000000000..2404d9535be
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/russiankoi8.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="KOI8-R"?>
+
+< ="">
+ <>
+ <></>
+ !
+ </>
+</>
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/russianutf8.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/russianutf8.xml
new file mode 100644
index 00000000000..735c9151641
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/russianutf8.xml
@@ -0,0 +1,7 @@
+<документ атт="русский" >
+ <раздел>
+ <голова>Тест</голова>
+ Здравствуй Мир!
+ </раздел>
+</документ>
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.cfg b/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.cfg
new file mode 100644
index 00000000000..2fc2494465e
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.cfg
@@ -0,0 +1,159 @@
+
+\ActivateASCII{0}
+\ActivateASCII{1}
+\ActivateASCII{2}
+\ActivateASCII{3}
+\ActivateASCII{4}
+\ActivateASCII{5}
+\ActivateASCII{6}
+\ActivateASCII{7}
+\ActivateASCII{8}
+\ActivateASCII{9}
+\ActivateASCII{0}
+\ActivateASCII{11}
+\ActivateASCII{12}
+\ActivateASCII{13}
+\ActivateASCII{14}
+\ActivateASCII{15}
+\ActivateASCII{16}
+\ActivateASCII{17}
+\ActivateASCII{18}
+\ActivateASCII{19}
+\ActivateASCII{20}
+\ActivateASCII{21}
+\ActivateASCII{22}
+\ActivateASCII{23}
+\ActivateASCII{24}
+\ActivateASCII{25}
+\ActivateASCII{26}
+\ActivateASCII{27}
+\ActivateASCII{28}
+\ActivateASCII{29}
+\ActivateASCII{30}
+\ActivateASCII{31}
+\ActivateASCII{32}
+\ActivateASCII{33}
+\ActivateASCII{34}
+\ActivateASCII{35}
+\ActivateASCII{36}
+\ActivateASCII{37}
+\ActivateASCII{38}
+\ActivateASCII{39}
+\ActivateASCII{30}
+\ActivateASCII{31}
+\ActivateASCII{32}
+\ActivateASCII{33}
+\ActivateASCII{34}
+\ActivateASCII{35}
+\ActivateASCII{36}
+\ActivateASCII{37}
+\ActivateASCII{38}
+\ActivateASCII{39}
+\ActivateASCII{40}
+\ActivateASCII{41}
+\ActivateASCII{42}
+\ActivateASCII{43}
+\ActivateASCII{44}
+\ActivateASCII{45}
+\ActivateASCII{46}
+\ActivateASCII{47}
+\ActivateASCII{48}
+\ActivateASCII{49}
+\ActivateASCII{50}
+\ActivateASCII{51}
+\ActivateASCII{52}
+\ActivateASCII{53}
+\ActivateASCII{54}
+\ActivateASCII{55}
+\ActivateASCII{56}
+\ActivateASCII{57}
+\ActivateASCII{58}
+\ActivateASCII{59}
+\ActivateASCII{60}
+\ActivateASCII{61}
+\ActivateASCII{62}
+\ActivateASCII{63}
+\ActivateASCII{64}
+\ActivateASCII{65}
+\ActivateASCII{66}
+\ActivateASCII{67}
+\ActivateASCII{68}
+\ActivateASCII{69}
+\ActivateASCII{70}
+\ActivateASCII{71}
+\ActivateASCII{72}
+\ActivateASCII{73}
+\ActivateASCII{74}
+\ActivateASCII{75}
+\ActivateASCII{76}
+\ActivateASCII{77}
+\ActivateASCII{78}
+\ActivateASCII{79}
+\ActivateASCII{80}
+\ActivateASCII{81}
+\ActivateASCII{82}
+\ActivateASCII{83}
+\ActivateASCII{84}
+\ActivateASCII{85}
+\ActivateASCII{86}
+\ActivateASCII{87}
+\ActivateASCII{88}
+\ActivateASCII{89}
+\ActivateASCII{90}
+\ActivateASCII{91}
+\ActivateASCII{92}
+\ActivateASCII{93}
+\ActivateASCII{94}
+\ActivateASCII{95}
+\ActivateASCII{96}
+\ActivateASCII{97}
+\ActivateASCII{98}
+\ActivateASCII{99}
+\ActivateASCII{100}
+\ActivateASCII{101}
+\ActivateASCII{102}
+\ActivateASCII{103}
+\ActivateASCII{104}
+\ActivateASCII{105}
+\ActivateASCII{106}
+\ActivateASCII{107}
+\ActivateASCII{108}
+\ActivateASCII{109}
+\ActivateASCII{110}
+\ActivateASCII{111}
+\ActivateASCII{112}
+\ActivateASCII{113}
+\ActivateASCII{114}
+\ActivateASCII{115}
+\ActivateASCII{116}
+\ActivateASCII{117}
+\ActivateASCII{118}
+\ActivateASCII{119}
+\ActivateASCII{120}
+\ActivateASCII{121}
+\ActivateASCII{122}
+\ActivateASCII{123}
+\ActivateASCII{124}
+\ActivateASCII{125}
+\ActivateASCII{126}
+\ActivateASCII{127}
+
+
+\UnicodeCharacter{105}{\textcolor{red}{i}}
+\UnicodeCharacter{97}{\textcolor{red}{a}}
+\UnicodeCharacter{101}{\textcolor{red}{e}}
+\UnicodeCharacter{105}{\textcolor{red}{i}}
+\UnicodeCharacter{111}{\textcolor{red}{o}}
+\UnicodeCharacter{117}{\textcolor{red}{u}}
+
+\UnicodeCharacter{48}{\textzerooldstyle}
+\UnicodeCharacter{49}{\textoneoldstyle}
+\UnicodeCharacter{50}{\texttwooldstyle}
+\UnicodeCharacter{51}{\textthreeoldstyle}
+\UnicodeCharacter{52}{\textfouroldstyle}
+\UnicodeCharacter{53}{\textfiveoldstyle}
+\UnicodeCharacter{54}{\textsixoldstyle}
+\UnicodeCharacter{55}{\textsevenoldstyle}
+\UnicodeCharacter{56}{\texteightoldstyle}
+\UnicodeCharacter{57}{\textnineoldstyle}
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.tex b/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.tex
new file mode 100644
index 00000000000..fccb7db53cc
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.tex
@@ -0,0 +1,4 @@
+\def\xmlfile{testascii.xml}
+\input xmltex
+
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.xml
new file mode 100644
index 00000000000..32a23354a6c
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/testascii.xml
@@ -0,0 +1,22 @@
+
+<doc xmlns="http://www.dcarlisle.demon.co.uk/sec">
+
+<sec><head>Heading <it>iii</it> example (123) </head>
+<p>
+This is an example of an experimental mode in which some
+of the characters in the standard `ascii' range are given special
+definitions. Vowels are made red, and digits (0123456789) are typeset in
+oldstyle form. Note that you may still use the sepcial letters as part
+of XML names, for example the follwoin word is set using the element `it':
+<it>italic</it>.
+</p>
+<p>
+While the special definitions apply to any text originating in the XML
+document they do not apply to texts coming from the TeX code and in
+particular from LaTeX packages. Note in this example that the
+section numbers are not old style and the vowels in the word `contents'
+are not coloured.
+</p>
+</sec>
+
+</doc>
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/testsec.tex b/Master/texmf-dist/doc/otherformats/xmltex/base/testsec.tex
new file mode 100644
index 00000000000..36136d92a3c
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/testsec.tex
@@ -0,0 +1,5 @@
+
+\def\xmlfile{testsec.xml}
+\input xmltex.tex
+
+
diff --git a/Master/texmf-dist/doc/otherformats/xmltex/base/testsec.xml b/Master/texmf-dist/doc/otherformats/xmltex/base/testsec.xml
new file mode 100644
index 00000000000..533e2663b45
--- /dev/null
+++ b/Master/texmf-dist/doc/otherformats/xmltex/base/testsec.xml
@@ -0,0 +1,77 @@
+
+<!DOCTYPE doc [
+<!ENTITY xx "<p>some text some text some text.</p>" >
+<!ENTITY xxx "&xx;" >
+]>
+
+<doc xmlns="http://www.dcarlisle.demon.co.uk/sec">
+
+<tt>lll</tt>
+<sec>
+ <head>This+&amp;&lt;&gt; <tt>code 111 {\tt 222} 333</tt></head>
+<p>The first section.</p>
+</sec>
+
+<sec>
+ <head>This+<![CDATA[&<>]]> <tt>code 999 {\tt 222} 333</tt></head>
+<p>The second section.</p>
+</sec>
+
+
+
+<p>abc+xyz &#113; (1:&amp; 2:&#38;)</p>
+
+&xxx;&xxx;&xxx;&xxx;&xxx;
+&xxx;&xxx;&xxx;&xxx;&xxx;
+
+<sec>
+ <head>Some utf8 [áéíóú] and some ascii [^^c3^^a1^^c3^^a9^^c3^^ad^^c3^^b3^^c3^^ba]</head>
+<p>and some more áéíóú</p>
+</sec>
+
+
+&xxx;&xxx;&xxx;&xxx;&xxx;
+&xxx;&xxx;&xxx;&xxx;&xxx;
+
+<sec>
+ <head>The End</head>
+<p>The last section.</p>
+</sec>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+<msub><mrow><mi>a</mi> <mo>+</mo> <mi>b</mi></mrow> <mn>2</mn> </msub>
+</math>
+
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+<mroot><mrow><mi>xxx</mi> <mo>-</mo> <mi>b</mi></mrow> <mn>3</mn> </mroot>
+</math>
+
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+<msubsup>
+ <mi>xxx</mi>
+ <mrow><mi>j</mi><mo>,</mo><mi>k</mi></mrow>
+ <mn>4</mn>
+</msubsup>
+</math>
+
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+<mfenced>
+<msup>
+ <mi>xxx</mi>
+ <mn>4</mn>
+</msup>
+</mfenced>
+
+<mfenced open="{" close="]" >
+<msup>
+ <mi>xxx</mi>
+ <mn>4</mn>
+</msup>
+</mfenced>
+
+</math>
+
+</doc> \ No newline at end of file