XML (Extensible Markup Language) Writer Parameters
FME features are written as rows, which are represented as XML elements in the output document belonging to a particular table, and defined through an XML DEF line.
The XML writer can be used to assemble XML documents. Very large datasets may be assembled by appending XML fragments to the root element. See Using the XML Writer In Append Mode.
Pretty Printing
Setting this parameter to Yes ensures the output is neatly formatted. This promotes easier reading on screen and in print output.
- Indent Size: Select a value from 0 to 9.
- Replace Tabs with Spaces: By default the Tab character is used to for indentations. Select Yes to substitute the Tab character with a Space.
- Text Indent: By default, the text in a tag is left untouched. Select Yes to include pretty printing in the text.
Note: Enabling this option produces a considerably larger output file due to added whitespace.
Advanced
Specifies the location for the XML Schema Document. If the parameter is not specified or if it does not contain a path, the XML schema document is generated in the same folder as the one specified through the Writer dataset.
If this parameter is set to a URI, then XSD output will be suppressed.
Note: This parameter is ignored if either of the special feature types XML_ROOT_ELEMENT or XML_FRAGMENT is present.
This parameter allows you to suppress the targetNamespace prefix for the generated XML Schema document.
This parameter is used in conjunction with the Wrap Table Elements Navigator parameter, and will take effect only if that parameter is set to Yes. The default value for this parameter is the empty string.
This parameter is used in conjunction with the Wrap Table Elements Navigator parameter and will take effect only if that parameter is set to Yes. The default value for this parameter is -table.
This parameter only takes effect if the Generate Row ID Attributes Workbench Navigator parameter is set to Yes. It specifies the name for an ID attribute for each element that represents a row of a table. The default value for this parameter is “row-id”.
This parameter only takes effect if the Generate Row ID Attributes Workbench Navigator parameter is set to Yes. It specifies the prefix for the unique positive integers that are generated as the values for the row IDs. This value may not start with a digit and its default value is “id”.
This parameter allows an XSLT style sheet to be applied to the final output document. The Style Sheet File to Write parameter may be used in conjunction with this parameter to specify the location and filename of the resulting transformation. There are no default values for this parameter.
This parameter only takes effect if the XSLT Style Sheet to Apply parameter is specified. When this parameter is not present or its value is the empty string, then the resulting XSLT transformation will have the same location and filename as the output dataset, with the exception that the filename will be prefixed with transformed_.
This parameter specifies a single element, or a path to a single element, in the document specified by the XML_ROOT_ELEMENT feature type.
Each element in the path is separated by a forward slash (/). A wildcard (*) may also be used as the prefix or local-name of the element (for example: *:e; p:*; or just *, which translates to *:*).
The parameter default value is the empty string. This will match or select the root element.
Consider the following XML document:
<data>
<metadata>…</metadata>
<initialize>…</initialize>
<!--Insert XML fragments here -->
<finalize>…</finalize>
</data>
To insert fragments after the <initialize> element, you can either:
- Select XML_ROOT_ELEMENT Append Path as “data/initialize”, and
- Set Append XML_FRAGMENTs As as Succeeding Siblings.
or:
- Select XML_ROOT_ELEMENT Append Path as “data/finalize”, and
- Set Append XML_FRAGMENTs As as Preceding Siblings.
This parameter controls how the fragments are inserted into the document in relation to the selected or matched element. The possible values for the parameter are:
- Preceding Children
- Succeeding Children
- Preceding Siblings
- Succeeding Siblings
The values are to be understood in relation to the selected or matched element.
When set to Yes, this parameter enables schema validation.
When XML Schema Validation is set to Yes, this parameter accepts an .xsd file that will be used to validate the writer output.