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.
Namespace Option
Allows you to specify a target namespace prefix for the generated XML Schema document.
If not specified, the default value depends on the value of Target Namespace URI. If Target Namespace URI is the default value, the default value for this parameter is fme. If Target Namespace URI is not the default value, the default value for this parameter becomes the default prefix, which is the empty string.
Allows you to specify a target namespace URI for the generated XML Schema document. All elements in the XML Schema document will reside in this namespace.
If not speicified, the default value is http://www.safe.com/xml/xmltables.
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.
Allows the generation of a tailored xfMap document that can be used by the XML Reader to read the output Dataset document back to FME.
Specifies additional XML Namespace Declarations for the root element in the output dataset. The values for this parameter are whitespace-separated prefix and URIs pairs. No default namespace declarations are allowed.
Specifies additional XML Namespace Declarations for the root element in the output dataset. The values for this parameter are whitespace-separated prefix and URIs pairs. No default namespace declarations are allowed.
When set to Yes (which is the default), elements that represent the rows for a particular table within the output Dataset document will be wrapped by a container element.
The wrapper element name will be the name of the rows prepended by the value of the Table Wrap Prefix and suffixed by the value of the Table Wrap Suffix.
When set to No (which is the default), this parameter allows the suppression of the actual XML document.
When set to No (which is the default), this parameter allows the suppression of the XML Schema document. If the XML Schema Document parameter is set to a URI, XSD output is suppressed regardless of this value.
When this parameter is set to Yes, an ID attribute of XML Schema type ID will be generated for each element that represents a row of a table.
The name of the attribute may be set by the Row ID Attribute Name parameter. The values generated for the ID attribute will be unique for the entire output dataset. The unique values are simply generated from a positive integer number count starting from 1, and since the XML Schema ID type does not allow an ID to start with a digit, the Row ID Prefix parameter's value is used to prefix the ID.
The default value is No.
Specifies the encoding for the output dataset document.