PREXML & POSTXML 1
NAME
prexml postxml − nroff processors to build xml files.
SYNOPSIS
prexml < file.tr | nroff -mux | postxml > file.xml
DESCRIPTION
Postxml provides a solution to build an xml file from a troff document that relies on nroff itself. Since nroff builds a plain text file from a troff document, it can be used, with an appropriate macro, to produce an intermediate file that postxml will translate to xml.
That intermediate file contains tags that postxml will transform to xml tags. If these tags are present in the source file, and need to be printed as is, prexml simply escapes these tags so that postxml won’t substitute them.
Since the final xml file might contain utf-8 characters, the -Tlocale option of nroff must be used. Utmac provides the ux macro that aims to be used with prexml and postxml. Troffxml comes with xsl stylesheets to create open document and html files. So, the command line could be:
prexml < file.tr | nroff −Tlocale \ −mux | postxml > file.xml xsltproc utohtml.xsl file.xml > file.html xsltproc utofodt.xsl file.xml > file.fodt
TAGS
Postxml
Postxml will substitute the following tags.
- #[: Replaced by <.
- #]: Replaced by >.
- #(: Replaced by &.
- #): Replaced by ;.
- #~: Replaced by #.
- \n#-\n: Removed from stream.
So the following text:
Some text #− #[a#] #− note text #[/a#] #(lt#).
Will be transform in:
Some text<a>note text</a> <.
Prexml
All these tags will be escaped by prexml if they are present in the original file, following these rules:
- #[: Replaced by #~[.
- #]: Replaced by #~].
- #(: Replaced by #~(.
- #): Replaced by #~).
- #~: Replaced by #~~.
- \n#-\n: Replaced by #~-.
FILES
- @BINDIR@/prexml @BINDIR@/postxml: Executables.
- @XSLDIR@/utohtml.xsl: XSL stylesheet to transform an utmac document to html.
- @XSLDIR@/utofodt.xsl: XSL stylesheet to transform an utmac document to flat odt.
- @XSLDIR@/utmac.ott: Open Document Text Template close to Utmac.
SEE ALSO
nroff(1).
LICENSE
Prexml, postxml and this man page are distributed under a isc license.
AUTHOR
Written by Pierre-Jean Fichet.