The simplest is to download and install XMLmind XML Editor Evaluation Edition from https://www.xmlmind.com/xmleditor/download.shtml.
You can then open this document —"XMLmind Assembly
Processor Manual", an assembly found in
—
in XMLmind XML Editor and use menu to convert it to any format you want. → assembly_install_dir
/docsrc/manual.xml
In order to explain how XMLmind Assembly
Processor is used, we'll convert this document —"XMLmind
Assembly Processor Manual", an assembly found in
—
first to multi-page HTML and then to PDF.assembly_install_dir
/docsrc/manual.xml
You'll find in
(Windows) and in
assembly_install_dir
/docsrc/convert_manual.bat
(Linux, Mac) a copy of the commands used in this chapter.assembly_install_dir
/docsrc/convert_manual.sh
Assembly manual.xml
contains a structure
specifying a book. The
content of the chapters and sections of this book is obtained from topics
such as intro.xml
,
requirements.xml
, install.xml
,
etc.
<structure renderas="book" xml:id="manual"> <merge> <title>XMLmind Assembly Processor Manual</title> <author> <personname>...</personname> ... </merge> <module renderas="chapter" resourceref="intro"/> <module renderas="chapter" xml:id="installation"> <merge> <title>Installing XMLmind Assembly Processor</title> </merge> <module renderas="section" resourceref="requirements"/> <module renderas="section" resourceref="install"/> ... </structure>
Example 3.1. Converting manual.xml
to multi-page
HTML
First, generate a “flat”, monolithic, book out of assembly
manual.xml
. This equivalent “flat” document is called
the realized document.
C:\XMLmind\assembly-2_0_1\docsrc> ..\..\bin\assembly(1)¬ -v(2) -format web(3)¬ manual.xml out\manual_realized_web.xml(4)
Finally, convert out/manual_realized_web.xml
to
multi-page HTML using the DocBook XSL
stylesheets.
C:\XMLmind\assembly-2_0_1\docsrc> java -cp C:\...\saxon.jar¬ com.icl.saxon.StyleSheet¬ -o ..\..\doc\manual\index.html out\manual_realized_web.xml(1)¬ C:\...\docbook-xsl-ns-1.79.1\html\chunk.xsl(2)¬ base.dir=../../doc/manual/(3)¬ chunk.section.depth=0¬ section.autolabel=1¬ section.label.includes.component.label=1¬ use.id.as.filename=1
| |
| |
|
Assembly manual.xml
contains only a single
structure. However, an assembly may contain several structure. By
default, assembly processes first found structure.
Option
-struct
allows to specify the structure_ID
xml:id
of the structure to be processed. In the case of the above example, we
could have invoked "assembly -struct manual
" because
the structure found in assembly manual.xml
starts
with:
<structure renderas="book" xml:id="manual">
...
Example 3.2. Converting manual.xml
to PDF
First, generate a “flat”, monolithic, book out of assembly
manual.xml
. The realized book is created in
out/manual_realized.xml
.
C:\XMLmind\assembly-2_0_1\docsrc> ..\..\bin\assembly -v¬ manual.xml out\manual_realized.xml
Second, transform out/manual_realized.xml
to XSL-FO (a standard
page description format) using XSLT stylesheet
fo/docbook.xsl
.
C:\XMLmind\assembly-2_0_1\docsrc> java -cp C:\...\saxon.jar¬ com.icl.saxon.StyleSheet¬ -o out\manual_realized.fo out\manual_realized.xml¬ C:\...\docbook-xsl-ns-1.79.1\fo\docbook.xsl¬ paper.type=A4¬ section.autolabel=1¬ section.label.includes.component.label=1¬ variablelist.as.blocks=1¬ ulink.show=0¬ shade.verbatim=1
Finally, convert the XSL-FO file to PDF using Apache FOP. The
PDF file is created in
../../doc/manual/manual.pdf
.
C:\XMLmind\assembly-2_0_1\docsrc> C:\...\fop-2.9\fop¬ -fo out\manual_realized.fo¬ -pdf ..\..\doc\manual\manual.pdf