XML Plugin (quokka.plugin.xml:0.3, namespace=xml)
The XML plugin allows transformations of XML via XSLT using bundled XML catalogs.
Template Targets
| transform |
If using the defaults, add any XML catalogues you are using to the xml-catalog path and add the XML transform library to the xml-transform classpath (e.g. saxon). You will also need to add ant-trax to the transform classpath is most cases.
The following is an example of using Saxon to transform a docbook file:
<dependency group="sf.saxon" version="6.5.3" paths="xml-transform"/>
<dependency group="sf.docbook.xsl" name="saxon65-ext" version="1.72" paths="xml-transform"/>
<dependency group="apache.ant" name="trax" version="1.7.1" paths="xml-transform"/>
<dependency group="quokka.xmlcat.docbook-xsl-1-72-0" version="0.1.1-ss" paths="xml-catalog"/>
<dependency group="quokka.xmlcat.docbook-dtd-4-5" version="0.1.1-ss" paths="xml-catalog"/>
<plugin group="quokka.plugin.xml" version="?">
<target template="transform" name="docbook" prefix="myproj.docbook">
<property name="in" value="src/docbook/master.xml"/>
<property name="out" value="${q.project.targetDir}/docbook/fo.xml"/>
<property name="style" value="src/docbook/styles/fopdf.xsl"/>
<property name="factory" value="com.icl.saxon.TransformerFactoryImpl"/>
</target>
</plugin>
Shared Default Properties
| q.xml.transform.defaults.transformClassPath | xml-transform | |
| q.xml.transform.defaults.catalogPath | xml-catalog | |
| q.xml.transform.defaults.targetDir | ${q.project.targetDir}/xml | |
| q.xml.transform.defaults.sourceDir | ${q.project.sourceDir}/xml |
Properties:
All properties are optional unless stated otherwise.
| out | The output file if transforming a single document |
| destDir | The destination directory if transforming mulitple documents |
| transformClassPath | The project path that contains the xml processor to use for the transform |
| style | Mandatory. The stylesheet to use |
| factory | The class name of the factory to use. e.g. com.icl.saxon.TransformerFactoryImpl |
| factory.params[] | A map of strings that are passed to the factory as parameters |
| params[] | A map of strings that are passed to the stylesheet as parameters |
| outputProperty[] | A map of strings that are passed as output properties to the transform |
| catalogPath | The project path containing any catalogues used during the tranform, such as the docbook catalogue. |
| basedir | where to find the source XML file, default is the project's basedir. |
| extension | desired file extension to be used for the targets. If not
specified, the default is ".html". Will be ignored if
a nested <mapper> has been specified. |
| force | Recreate target files, even if they are newer than their corresponding source files or the stylesheet. Defaults to false |
| includes | comma- or space-separated list of patterns of files that must be included. All files are included when omitted. |
| includesFile | the name of a file. Each line of this file is taken to be an include pattern |
| excludes | comma- or space-separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. |
| excludesFile | the name of a file. Each line of this file is taken to be an exclude pattern |
| defaultExcludes | indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. |
| scanIncludedDirectories | If any directories are matched by the
includes/excludes patterns, try to transform all files in these
directories. Default is true
|
Default Properties
| * | ${prefix.defs} |
| defs | ${@ifdef prefix.defaults ? prefix.defaults : 'q.xml.transform.defaults'} |
Plugin Paths
runtime : Runtime class path
quokka.core.metadata metadata 0.3
quokka.core.plugin-spi plugin-spi 0.3
quokka.core.util util 0.3
quokka.core.bootstrap-util bootstrap-util 0.3
quokka.core.repo-spi repo-spi 0.3
apache.ant ant 1.7.1
apache.ant trax 1.7.1
apache.ant ant 1.7.1
apache.ant launcher 1.7.1