Added support for embedded MathML and SVG.
New element: <example>.
Use standard XML Inclusion methods as opposed to a preprocessing stylesheet.
- This means the <include> element will be deprecated.
New type styles: big and small.
Added colored text with a few predefined colors.
+Version 0.6 - Oct 17, 2007
+===========================================================
+
+o The conversion to HTML creates proper XHTML.
+o Added support for embedded MathML and SVG.
+o New element: <example>.
+o Use standard XML Inclusion methods as opposed to a preprocessing stylesheet.
+ - This means the <include> element will be deprecated.
+o New output format for PHPWiki.
+o New type styles: big and small.
+o Added colored text with a few predefined colors.
+
Version 0.5 - Aug 19, 2003
===========================================================
<!ELEMENT doc (book | article | report)>
<!ATTLIST doc
- style CDATA #IMPLIED
+ style CDATA #IMPLIED
+ latexoptions CDATA "a4paper"
>
<!ELEMENT book (titlepage?, toc?, (chapter|include)*)>
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
-->
<chapter>
To make several separate paragraphs, you must enclose each paragraph
in a <strong>para</strong> open tag and a <strong>para</strong> close tag.
Here is an example of two small paragraphs:
+</para>
+
<verbatim>
<para>
</verbatim>
-</para>
-
<para>
A second type of paragraph is a <strong>quote</strong>.
You can make a quote by using the <code>quote</code> element:
+</para>
<verbatim>
<quote>
</quote>
</verbatim>
+<para>
Which results in:
+</para>
<quote>
This is an example of a quote.
The text within a quoted paragraph is usually slightly indented on both
the left and the right margin.
</quote>
-</para>
<para>
A special kind of paragraph is the <strong>verbatim</strong> environment.
indentation and line breaks preserved.
The practical use for the <strong>verbatim</strong> element is to
include coding examples, such as:
+</para>
<verbatim>
<verbatim>
</verbatim>
</verbatim>
+<para>
Which comes out like this:
+</para>
<verbatim>
struct complex
double imaginary;
};
</verbatim>
+
+<para>
+A variation on the <strong>verbatim</strong> text is the <strong>example</strong>
+text.
+The only real difference is that <strong>example</strong> is placed inside
+a box to make it stand out a bit more.
+In fact, when converted to XHTML, only an attribute <code>class='example'</code>
+is added.
+It is up to the CSS linked to the XHTML page to add additional layout features.
+The default styling will only add a border.
+Here is the above example shown in an actual <strong>example</strong> element:
+</para>
+
+<example>
+ <example>
+ struct complex
+ {
+ double real;
+ double imaginary;
+ };
+ </example>
+</example>
+
+<para>
+Which comes out like this:
</para>
+
+<example>
+ struct complex
+ {
+ double real;
+ double imaginary;
+ };
+</example>
+
</section>
<section>
<para>
Footnotes are created with the <strong>footnote</strong> element:
<footnote>This is an example of a footnote</footnote>
+</para>
<verbatim>
<footnote>This is an example of a footnote</footnote>
</verbatim>
+<para>
Within a footnote, you can use <emph>inline</emph> content <footnote>described in the
next chapter</footnote> to format the type
styles of the text in the footnote.
<heading><label name='list'/>Lists</heading>
<para>
Three types of lists are supported:
+</para>
+
<itemize>
<item><code>itemize</code> for bulleted lists such as this one.</item>
<item><code>enumerate</code> for numbered lists.</item>
<item><code>description</code> for tagged lists.</item>
</itemize>
+<para>
Each item in such a list must be in an <code>item</code> element.
In fact, an <code>item</code> is the only element allowed in an
<code>itemize</code>, <code>enumerate</code> or <code>description</code> element.
You should not put ordinary text or any other element in a list without
enclosing them in <code><item></code> and <code></item></code>.
Here is an example of a numbered list:
+</para>
<verbatim>
</verbatim>
+<para>
And this is what the list turns into:
+</para>
<enumerate>
<item>First you need an enumerate, itemize or description tag.</item>
<item>Finally, put the content inside the items.</item>
</enumerate>
+<para>
In a description list, you make your own tags for each item instead
of the automatically generated bullts or numbers.
The tags for each item go in the <code>tag</code> attribute of the
<code>item</code> element.
So, repeating the above list as a description list:
+</para>
<verbatim>
<description>
</description>
</verbatim>
+<para>
Which creates the following output:
+</para>
<description>
<item tag='itemize'> for bulleted lists.</item>
<item tag='description'> for tagged lists such as this one.</item>
</description>
+<para>
An item can contain inline content as well as block-level content.
</para>
</section>
<para>
The empty element <strong>picture</strong> is used to include
graphics in your document, like this:
+</para>
<verbatim>
<picture src='diagram.png' eps='diagram' scale='0.5'/>
</verbatim>
+<para>
The two attributes are used in either HTML or LaTeX.
</para>
</section>
<para>
An example of a table is shown below:
+</para>
<verbatim>
<row><col>Wine </col><col> 2.20</col></row>
</table>
-</para>
</section>
</chapter>
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.1 $
+ Version : $Revision: 1.2 $
-->
<chapter>
Creates a <ref to='list'>list</ref> of numbered items.
</item>
+ <item tag='example'>
+ A <ref to='block'>block-level</ref> element to hold text with a
+ pre-determined layout. The block of text is surrounded by a border.
+ </item>
+
<item tag='footnote'>
Creates a numbered <ref to='footnote'>footnote</ref> at the bottom of the page.
</item>
<item tag='include'>
Includes part of the document from another <ref to='include'>file</ref>.
+ <emph>Deprecated</emph>. Use the standard XML Inclusion method instead.
</item>
<item tag='infoitem'>
<?xml version="1.0"?>
<!DOCTYPE doc SYSTEM "../doc.dtd">
<?xml-stylesheet type="text/xsl" href="../html.xsl"?>
-<doc style="main.css">
+<doc style="main.css"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
This document is prepared for XMLDoc. Transform to HTML,
LaTeX, Postscript or plain text with XMLDoc utilities and
<subtitle>Document preparation and conversion in XML</subtitle>
<author>Arjen Baart <code><arjen@andromeda.nl></code></author>
- <date>Aug 18, 2003</date>
+ <date>Oct 17, 2007</date>
<docinfo>
- <infoitem label="Version">0.5</infoitem>
+ <infoitem label="Version">0.6</infoitem>
<infoitem label="Organization">Andromeda Technology & Automation</infoitem>
</docinfo>
<abstract>
<toc/>
-<include href="intro.xml"/>
+<xi:include href="intro.xml"/>
-<include href="overall.xml"/>
+<xi:include href="overall.xml"/>
-<include href="block.xml"/>
+<xi:include href="block.xml"/>
-<include href="inline.xml"/>
+<xi:include href="inline.xml"/>
<chapter>
<heading>References</heading>
We need to add one more attribute to the usual <strong>href</strong>
attribute.
For example:
+</para>
+
<verbatim>
<reference xml:link="simple"
href="http://www.andromeda.nl/project/xmldoc/xmldoc.html">
</reference>
provide the installation instructions.
</verbatim>
+
+<para>
<reference xml:link="simple"
href="http://www.andromeda.nl/projects/xmldoc/xmldoc.html">
The XMLDoc website
Each <code>label</code> must have a <code>name</code> that is unique
throughout the document.
Here is an example of a label:
+</para>
<verbatim>
<label name='example'/>
</verbatim>
+<para>
You can refer to a label from any other place in the document by using a
<code>ref</code> or a <code>page</code> element.
The <code>page</code> element creates a reference to the page number on which
This is of course only usefull on printed media, such as LaTeX.
The <code>ref</code> and <code>page</code> elements also require one
attribute:
+</para>
<verbatim>
<ref to='example'>example reference</ref>
</verbatim>
+
+<para>
The required attribute <code>to</code> holds the name of the
label to which the reference refers.
The <code>ref</code> element is usually not empty.
</para>
</chapter>
-<include href="multifiles.xml"/>
+<xi:include href="multifiles.xml"/>
+
+<xi:include href="glossary.xml"/>
-<include href="glossary.xml"/>
+<chapter>
+
+<heading>Other XML applications</heading>
+<section>
+<heading>MathML</heading>
+</section>
+<math>
+ <mrow>
+ <msup>
+ <mfenced open="[" close="]">
+ <mrow>
+ <mi>θ</mi>
+ <mo>+</mo>
+
+ <mi>b</mi>
+ </mrow>
+ </mfenced>
+ <mn>260</mn>
+ </msup>
+ <mo>+</mo>
+ <msub>
+
+ <mfenced open="{" close="}">
+ <mrow>
+ <mi>a</mi>
+ <mo>+</mo>
+ <mi>b</mi>
+ </mrow>
+ </mfenced>
+
+ <mi>i</mi>
+ </msub>
+ </mrow>
+</math>
+<section>
+<heading>SVG</heading>
+
+<svg>
+ <clipPath id="a">
+ <circle cy="90" cx="100" r="60"/>
+ </clipPath>
+ <circle fill="#AAAAAA" cy="90" cx="190"
+ r="60" style="clip-path:url(#a)"/>
+ <circle stroke="black" fill="none" cy="90" cx="100" r="60"/>
+ <circle stroke="black" fill="none" cy="90" cx="190" r="60"/>
+</svg>
+
+
+</section>
+</chapter>
<chapter>
<heading>Things to do</heading>
<itemize>
-<item>Math</item>
+<item>MathML and SVG conversion to LaTeX</item>
<item>XML Schema definition and validation</item>
<item>Font sizes</item>
<item>Center environment</item>
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
-->
<chapter>
<heading><label name='inline'/>Type styles and special characters</heading>
<para>
There are six type styles:
+</para>
<enumerate>
<item><code>emph</code> : <emph>Emphasized text</emph></item>
<item><code>strong</code> : <strong>Usually bold face</strong></item>
<item><code>sub</code> : For <sub>subscript</sub> text.</item>
<item><code>sup</code> : For <sup>superscript</sup> text.</item>
</enumerate>
+
+<section>
+<heading><label name='color'/>Color and size</heading>
+<para>
+Normally, if not redefined by additional style sheets, the text is
+printed in black on a white background.
+You can create text in other colors with the <strong>color</strong> element.
+Which color the output text should become is specified in the
+<strong>colorname</strong> attribute, for example:
+</para>
+
+<verbatim>
+ <color colorname='red'>Red text</color>
+</verbatim>
+
+<para>
+It is not possible to create any color; there are just a few predefined
+colors available:
+<color colorname='red'>red</color>,
+<color colorname='green'>green</color>,
+<color colorname='blue'>blue</color>,
+<color colorname='cyan'>cyan</color>,
+<color colorname='magenta'>magenta</color>,
+<color colorname='yellow'>yellow</color>,
+<color colorname='orange'>orange</color>,
+<color colorname='violet'>violet</color>,
+<color colorname='purple'>purple</color>,
+<color colorname='brown'>brown</color>,
+<color colorname='pink'>pink</color>,
+<color colorname='olive'>olive</color>,
+<color colorname='black'>black</color>,
+<color colorname='darkgray'>darkgray</color>,
+<color colorname='gray'>gray</color>,
+<color colorname='lightgray'>lightgray</color> and
+<color colorname='white'>white</color>.
+The last, color (white) is probably invisible :-).
+</para>
+
+<para>
+NOTE: To make colored text work with LaTeX, you probably need to install
+the <emph>latex-xcolor</emph> package.
+</para>
+<para>
+Apart from the normal font size, there are two other sizes available:
+<strong>big</strong>and <strong>small</strong>.
+These element will make the text slightly bigger or smaller, like this:
</para>
+<verbatim>
+Here is <small>some small text</small> and <big>a big phrase</big>.
+</verbatim>
+<para>
+Here is <small>some small text</small> and <big>a big phrase</big>.
+</para>
+</section>
<section>
<heading><label name='break'/>Line and page breaking</heading>
into the output.
One of the applications of the <code>LaTeX</code> escape element is to
control the first line indent of a paragraph in LaTeX:
+</para>
<verbatim>
<LaTeX command='\setlength{\parindent}{0cm}'/>
</verbatim>
+<para>
Note that it is not possible to create HTML tags in this manner.
</para>
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
-->
<chapter>
scripts to transform the document an another format.
For example, to transform this guide into a LaTeX document, you could
use:
+</para>
<verbatim>
xml2latex guide.xml >guide.tex
</verbatim>
+<para>
Note that the transformed document is written to standard output.
</para>
</section>
font-size : 100%;
}
+pre.example
+{
+ background : lightblue ;
+ width : 90% ;
+ margin-left: 5% ;
+}
+
span.remark
{
font-size : 90%;
PICTURES=
-html: guide.html
+html: guide.xhtml
ps: guide.ps
all: ps html txt
-guide.html : $(XMLS) $(IMAGES) ../html.xsl
- ../xp ../preprocess.xsl guide.xml >guide.tmp
- ../xp ../html.xsl guide.tmp > guide.html
- rm guide.tmp
+guide.xhtml : $(XMLS) $(IMAGES) ../html.xsl
+ ../xp ../html.xsl guide.xml > guide.xhtml
guide.ps : $(XMLS) $(PICTURES) ../latex.xsl ../xp
- ../xp ../preprocess.xsl guide.xml >guide.tmp
- ../xp --latex ../latex.xsl guide.tmp > guide.tex
+ ../xp --latex ../latex.xsl guide.xml > guide.tex
latex guide.tex
dvips -o guide.ps guide.dvi
- rm guide.tmp
guide.pdf : $(XMLS) $(PICTURES) ../latex.xsl ../xp
- ../xp ../preprocess.xsl guide.xml >guide.tmp
- ../xp --latex ../latex.xsl guide.tmp > guide.tex
+ ../xp --latex ../latex.xsl guide.xml > guide.tex
pdflatex guide.tex
- rm guide.tmp
guide.txt : $(XMLS) ../text.xsl
- ../xp ../preprocess.xsl guide.xml >guide.tmp
- ../xp ../text.xsl guide.tmp > guide.txt
- rm guide.tmp
+ ../xp ../text.xsl guide.xml > guide.txt
check:
- xmllint --noout --valid $(XMLS)
+ xmllint --noout --xinclude --loaddtd --noent --schema ../doc.xsd guide.xml
+# xmllint --noout --valid $(XMLS)
+
clean:
- rm -f guide.html guide.ps guide.tex guide.dvi guide.log guide.txt guide.pdf
+ rm -f guide.xhtml guide.ps guide.tex guide.dvi guide.log guide.txt guide.pdf
rm -f $(IMAGES) $(PICTURES)
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
-->
<chapter>
</para>
<para>
To include another XML file in your root document, use the
-<strong>include</strong> element with a single attribute to specify
+standard XML <strong>XInclude</strong> system with a single attribute to specify
the name of the file to be included.
+Other attributes, as well as the <strong>fallback</strong> element,
+are of course supported as well.
+Refer to the <reference href='http://www.w3.org/TR/2006/REC-xinclude-20061115/'>
+XML Inclusions</reference> standard for more information.
For example, this chapter is in a file called "multifiles.xml", which
is included in the main document with:
+</para>
+
<verbatim>
-<include href="multifiles.xml"/>
+<xi:include href="multifiles.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude"/>
</verbatim>
-There is one restriction to including other files: The included files
-must be valid XML files as well.
-It is not possible to include other kinds of files, such as raw text
-or source code.
-So, the included XML file starts with the usual XML declaration, but has
+
+<para>
+Remember to put the <strong>xi:include</strong> in the proper namespace.
+Normally, the included files must be valid XML files as well.
+To include other kinds of files, such as raw text or source code, the attribute
+<strong>parse='text'</strong> must be added to the <strong>include</strong> element.
+When including another XML document, the included XML file starts with the
+usual XML declaration, but has
a different root element declared in the <!DOCTYPE...> declaration:
+</para>
<verbatim>
<?xml version="1.0"?>
</chapter>
</verbatim>
-</para>
</section>
<section>
<heading>Multiple output files</heading>
<!--
XML documentation system
Original author : Arjen Baart - arjen@andromeda.nl
- Version : $Revision: 1.2 $
+ Version : $Revision: 1.3 $
-->
The structure of the document is layed out by its chapters, sections
within the chapters, subsections within the sections and so on.
Just as in LaTeX and HTML, there are six levels of sectioning elements available:
+</para>
<enumerate>
<item><code>chapter</code>: For top-level chapters.</item>
<item><code>section</code>: For second-level sections, i.e. 1.1, 1.2, 1.3
<item><code>paragraph</code>: The fifth-level sections</item>
<item><code>subparagraph</code>: The sixth and final level.</item>
</enumerate>
+<para>
Note that the names are equivalent to their counterparts in LaTeX.
</para>
<strong>xml2html</strong>, by using the <strong>style</strong> attribute
in the <strong>doc</strong> element.
Here is an example:
+</para>
<verbatim>
<doc style="main.css">
</verbatim>
-</para>
</section>
</chapter>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:strip-space elements="doc chapter section"/>
-<xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
+<xsl:output method="xml" indent="yes" encoding="iso-8859-1"
+ doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
+ doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"/>
<xsl:template match="doc">
<html>
+ <xsl:attribute name='xmlns'>http://www.w3.org/1999/xhtml</xsl:attribute>
<head>
<link>
<xsl:attribute name="rel">stylesheet</xsl:attribute>
<title>
<xsl:value-of select="*/titlepage/title"/>
</title>
+ <style type="text/css">
+ .center
+ {
+ text-align : center ;
+ }
+ table.docinfo
+ {
+ margin-left : 10% ;
+ margin-right : 10% ;
+ border-style : solid ;
+ }
+ th
+ {
+ border-style : solid ;
+ border-width : thin ;
+ }
+ h3.toc
+ {
+ margin-left : 2em ;
+ }
+ pre.example
+ {
+ border : solid ;
+ padding-bottom : 1em ;
+ }
+ span.red
+ {
+ color : red ;
+ }
+ span.green
+ {
+ color : green ;
+ }
+ span.blue
+ {
+ color : blue ;
+ }
+ span.cyan
+ {
+ color : cyan ;
+ }
+ span.magenta
+ {
+ color : magenta ;
+ }
+ span.yellow
+ {
+ color : yellow ;
+ }
+ span.orange
+ {
+ color : orange ;
+ }
+ span.violet
+ {
+ color : violet ;
+ }
+ span.purple
+ {
+ color : purple ;
+ }
+ span.brown
+ {
+ color : brown ;
+ }
+ span.pink
+ {
+ color : pink ;
+ }
+ span.olive
+ {
+ color : olive ;
+ }
+ span.black
+ {
+ color : black ;
+ }
+ span.darkgray
+ {
+ color : darkgray ;
+ }
+ span.gray
+ {
+ color : gray ;
+ }
+ span.lightgray
+ {
+ color : lightgray ;
+ }
+ span.white
+ {
+ color : white ;
+ }
+ </style>
</head>
<body>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="docinfo">
- <center><table border="2" width="90%">
+ <table class="docinfo">
<tr><th colspan="2">Document Information</th></tr>
<xsl:apply-templates/>
- </table></center>
+ </table>
</xsl:template>
<xsl:template match="infoitem">
<xsl:template match="abstract">
<blockquote>
- <b>Abstract:</b><br/>
+ <p><b>Abstract:</b></p>
+ <p>
<xsl:apply-templates/>
+ </p>
</blockquote>
</xsl:template>
<xsl:value-of select="heading"/>
</a>
</h2>
- <ul>
<xsl:for-each select="section">
- <h3>
+ <h3 class="toc">
<xsl:number count="chapter|section" level="multiple" format="1.1 "/>
<a>
<xsl:attribute name="href">#SEC<xsl:number count="chapter|section" level="multiple" format="1.1"/></xsl:attribute>
</a>
</h3>
</xsl:for-each>
- </ul>
</xsl:for-each>
<hr></hr>
</xsl:template>
<xsl:number count="chapter"/>
<xsl:text> </xsl:text>
<a>
- <xsl:attribute name="name">CH<xsl:number count="chapter"/></xsl:attribute>
+ <xsl:attribute name="id">CH<xsl:number count="chapter"/></xsl:attribute>
</a>
<xsl:apply-templates/>
</h1>
<h2>
<xsl:number count="chapter|section" level="multiple" format="1.1 "/>
<a>
- <xsl:attribute name="name">SEC<xsl:number count="chapter|section" level="multiple" format="1.1"/></xsl:attribute>
+ <xsl:attribute name="id">SEC<xsl:number count="chapter|section" level="multiple" format="1.1"/></xsl:attribute>
</a>
<xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="quote">
- <blockquote>
+ <blockquote><p>
<xsl:apply-templates/>
- </blockquote>
+ </p></blockquote>
</xsl:template>
<xsl:template match="verbatim">
</pre>
</xsl:template>
+<xsl:template match="example">
+<pre class='example'>
+ <xsl:apply-templates/>
+</pre>
+</xsl:template>
+
<xsl:template match="itemize">
<ul>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="footnote" mode="footnotes">
-<sup><a><xsl:attribute name='name'>footnote<xsl:number level='any'/></xsl:attribute>
- <xsl:number level='any'/></a></sup> <xsl:apply-templates/><br/>
-
+<p>
+<sup><a><xsl:attribute name='id'>footnote<xsl:number level='any'/></xsl:attribute>
+ <xsl:number level='any'/></a></sup> <xsl:apply-templates/>
+</p>
</xsl:template>
<xsl:template match="emph">
<sup><xsl:apply-templates/></sup>
</xsl:template>
+<xsl:template match="color">
+<span><xsl:attribute name="class"><xsl:value-of select="@colorname"/></xsl:attribute><xsl:apply-templates/></span>
+</xsl:template>
+
+<xsl:template match="big">
+<big><xsl:apply-templates/></big>
+</xsl:template>
+
+<xsl:template match="small">
+<small><xsl:apply-templates/></small>
+</xsl:template>
+
<xsl:template match="table">
<table>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="label">
- <a><xsl:attribute name='name'>
+ <a><xsl:attribute name='id'>
<xsl:value-of select="@name"/>
</xsl:attribute></a>
</xsl:template>
</a>
</xsl:template>
+<xsl:template match="math">
+<math>
+<xsl:attribute name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:attribute>
+<xsl:copy-of select='./*'/>
+</math>
+</xsl:template>
+
+<xsl:template match="svg">
+<svg>
+<xsl:attribute name="xmlns">http://www.w3.org/2000/svg</xsl:attribute>
+<xsl:copy-of select='./*'/>
+</svg>
+</xsl:template>
+
</xsl:stylesheet>
<xsl:template match="article">
\documentclass[a4paper]{article}
+\usepackage{xcolor}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{marvosym}
<xsl:template match="book">
\documentclass[a4paper]{book}
+\usepackage{xcolor}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{marvosym}
<xsl:template match="report">
\documentclass[a4paper]{report}
+\usepackage{xcolor}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{marvosym}
\end{verbatim}
</xsl:template>
+<xsl:template match="example">
+\begin{verbatim}
+\makebox{ <xsl:apply-templates/> }
+\end{verbatim}
+</xsl:template>
+
<xsl:template match="itemize">
\begin{itemize}
<xsl:apply-templates/>
<xsl:template match="sub">$_{<xsl:apply-templates/>}$</xsl:template>
<xsl:template match="sup">$^{<xsl:apply-templates/>}$</xsl:template>
+<xsl:template match="color">\textcolor{<xsl:value-of select="@colorname"/>}{<xsl:apply-templates/>}</xsl:template>
+
+<xsl:template match="big">\large{<xsl:apply-templates/>}</xsl:template>
+<xsl:template match="small">\small{<xsl:apply-templates/>}</xsl:template>
+
<xsl:template match="newline">\\</xsl:template>
<xsl:template match="newpage">\newpage</xsl:template>
esac
shift
done
-TMPFILE=`mktemp /tmp/xmldoc.XXXXXX`
-xp $XSLDIR/preprocess.xsl $inputs >$TMPFILE
-xp $stylesheet $TMPFILE
+#TMPFILE=`mktemp /tmp/xmldoc.XXXXXX`
+#xp $XSLDIR/preprocess.xsl $inputs >$TMPFILE
+xp $stylesheet $inputs
esac
shift
done
-TMPFILE=`mktemp /tmp/xmldoc.XXXXXX`
-xp $XSLDIR/preprocess.xsl $inputs >$TMPFILE
-xp --latex $stylesheet $TMPFILE
+#TMPFILE=`mktemp /tmp/xmldoc.XXXXXX`
+#xp $XSLDIR/preprocess.xsl $inputs >$TMPFILE
+xp --latex $stylesheet $inputs
esac
shift
done
-TMPFILE=`mktemp /tmp/xmldoc.XXXXXX`
-xp $XSLDIR/preprocess.xsl $inputs >$TMPFILE
-xp $stylesheet $TMPFILE
+#TMPFILE=`mktemp /tmp/xmldoc.XXXXXX`
+#xp $XSLDIR/preprocess.xsl $inputs >$TMPFILE
+xp $stylesheet $inputs
#include <libxml/debugXML.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlIO.h>
-#ifdef LIBXML_DOCB_ENABLED
-#include <libxml/DOCBparser.h>
-#endif
#ifdef LIBXML_XINCLUDE_ENABLED
#include <libxml/xinclude.h>
#endif
#ifdef LIBXML_HTML_ENABLED
static int html = 0;
#endif
-#ifdef LIBXML_XINCLUDE_ENABLED
-static int xinclude = 0;
-#endif
-static int profile = 0;
static const char *params[16 + 1];
static int nbparams = 0;
static const char *output = NULL;
+void LatexEscape(xmlNodePtr node);
+
/*
* The LaTeX translation table. Translate unicodes to LaTeX escape sequences.
*/
xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
xmlDocPtr res;
-#ifdef LIBXML_XINCLUDE_ENABLED
- if (xinclude) {
- xmlXIncludeProcess(doc);
+ xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
+
+ if (latex)
+ {
+ LatexEscape(xmlDocGetRootElement(doc));
}
-#endif
+
if (output == NULL) {
- if (profile) {
- res = xsltProfileStylesheet(cur, doc, params, stderr);
- } else {
- res = xsltApplyStylesheet(cur, doc, params);
- }
+ res = xsltApplyStylesheet(cur, doc, params);
+
xmlFreeDoc(doc);
if (res == NULL) {
fprintf(stderr, "no result for %s\n", filename);
if (xmlNodeIsText(node))
{
#ifdef DEBUG
- fprintf(stderr, "\n-------- Text node (%d bytes):\n%s",
- strlen(node->content), node->content);
+ fprintf(stderr, "\n-------- Text node at %p (%d bytes):\n%s",
+ node, strlen(node->content), node->content);
#endif
textlen = strlen(node->content);
{
for (child = node->children; child != 0; child = child->next)
{
- if (strcmp(child->name, "verbatim") != 0)
+ if (strcmp(child->name, "verbatim") != 0 )
{
LatexEscape(child);
}
printf("\t otherwise XML Catalogs starting from \n");
printf("\t file:///etc/xml/catalog are activated by default\n");
#endif
-#ifdef LIBXML_XINCLUDE_ENABLED
- printf("\t--xinclude : do XInclude processing on document intput\n");
-#endif
- printf("\t--profile or --norman : dump profiling informations \n");
}
int
} else if ((!strcmp(argv[i], "-noout")) ||
(!strcmp(argv[i], "--noout"))) {
noout++;
-#ifdef LIBXML_DOCB_ENABLED
- } else if ((!strcmp(argv[i], "-docbook")) ||
- (!strcmp(argv[i], "--docbook"))) {
- docbook++;
-#endif
#ifdef LIBXML_HTML_ENABLED
} else if ((!strcmp(argv[i], "-html")) ||
(!strcmp(argv[i], "--html"))) {
html++;
#endif
- } else if ((!strcmp(argv[i], "-profile")) ||
- (!strcmp(argv[i], "--profile"))) {
- profile++;
- } else if ((!strcmp(argv[i], "-norman")) ||
- (!strcmp(argv[i], "--norman"))) {
- profile++;
} else if ((!strcmp(argv[i], "-nonet")) ||
(!strcmp(argv[i], "--nonet"))) {
xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
} else {
xmlLoadCatalogs(catalogs);
}
-#endif
-#ifdef LIBXML_XINCLUDE_ENABLED
- } else if ((!strcmp(argv[i], "-xinclude")) ||
- (!strcmp(argv[i], "--xinclude"))) {
- xinclude++;
- xsltSetXIncludeDefault(1);
#endif
} else if ((!strcmp(argv[i], "-param")) ||
(!strcmp(argv[i], "--param"))) {
}
params[nbparams] = NULL;
+ xsltSetXIncludeDefault(1);
/*
* Replace entities with their content.
*/
if (html)
doc = htmlParseFile(argv[i], NULL);
else
-#endif
-#ifdef LIBXML_DOCB_ENABLED
- if (docbook)
- doc = docbParseFile(argv[i], NULL);
- else
#endif
doc = xmlParseFile(argv[i]);
if (doc == NULL) {
fprintf(stderr, "unable to parse %s\n", argv[i]);
continue;
}
- if (latex)
- {
- LatexEscape(xmlDocGetRootElement(doc));
- }
xsltProcess(doc, cur, argv[i]);
}
}