AlvisNLP

corpus processing engine

XMLWriter

Synopsis

Writes the corpus data structure into a file via an XSLT stylesheet.

Description

XMLWriter evaluates roots as a list of elements. The for each element, it writes a file using the xslTransform stylesheet. The file name is specified by the evaluation of fileName as a string with the root element as he context element. Relative file names are relative to outDir .

The stylesheet operates on an empty XML document bound to the root element, however XMLWriter provides XSLT element and function extensions in order to retrieve elements as a DOM structure. All extensions are defined in the namespace xalan://fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.modules.xml.XMLWriter2 .

Extension functions

Snippet

<xmlwriter class="XMLWriter">
    <fileName></fileName>
    <outDir></outDir>
    <roots></roots>
    <xslTransform></xslTransform>
</xmlwriter>

Mandatory parameters

fileName

Mandatory
Type: Expression

Expression evaluated as a string with the file root element as the context element. The result specifies the file where to write the result.

outDir

Mandatory

Base directory where all file are written.

roots

Mandatory
Type: Expression

Expression evaluated as a list of elements with the corpus as the context element. XMLWriter writes a file for each element in the result.

xslTransform

Mandatory

XSLT stylesheet that specifies the output.

Optional parameters

indent

Default value: `true`
Type: Boolean

Either to indent the resulting XML.

Deprecated parameters