XSD-Driven XML Writer Parameters
Application Schema
XSD Selection
Specifies the location of the XSD Schema document.
xsi:schemaLocation
Specifies the location of the XSD Schema document via whitespace-separated namespace-URI and xsd-location-URL pairs, following the same syntax as the xsi:schemaLocation attribute.
For example, the following specifies two URI-URL pairs:
http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd urn:cgi:xmlns:CGI:GeoSciML:2.0 http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd
Features
Feature Paths
Identifies the top-level element, or any descendant of a top-level element, in the XSD Schemas that should be mapped into FME features.
A single top-level element can be identified via a qualified name, QName, which is a colon-separated optional prefix and a local name. The prefix or local-name part may also be set to an asterisk (*) wildcard. For example:
- a:feature
- feature
- *:feature
- a:*
Paths of QNames (forward-slash-separated (/) QNames) must be used to map non-top-level elements defined in the XSD Schema. The non-top-level element declarations must be reachable via a top-level element. Thus, the first QName in the path must be a top-level element. For example:
rdf:RDF/cim:ConnectivityNode
where the XSD Schema declares “RDF” as a top-level element, but “ConnectivityNode” is only declared locally within “RDF”.
Multiple feature paths are separated via whitespace.
XSD Types as Features
Specifies a white-space-separated list of complex type definition QNames. Element declarations in the XSD Schema whose type matches or extends any of the listed type definitions in this parameter will be mapped into an FME feature.
Attributes
Elements as XML Fragments
Specifies a white-space-separated list of single-element QNames and/or white-space-separated list of path of QNames that should be mapped into xml fragment attributes.
The last element in the path of QNames is the element that should be mapped into an xml fragment attribute; ancestor elements in the path act as conditionals for the element to map. For example, given the QName Path “a/b/c”, where <a> is being mapped as a feature, then only <c> elements with a <b> parent will be mapped into an xml fragment attribute.
XSD Types as XML Fragments
Specifies a white-space-separated list of complex type definition QNames. Element declarations in the XSD Schema whose type matches or extends any of the listed type definitions will be mapped into xml fragment attributes.
Elements as Attributes to Ignore
Specifies a white-space-separated list of single-element QNames and/or white-space-separated list of path of QNames that should be ignored as attributes.
The last element in the path of QNames is the element to ignore; ancestor elements in the path act as conditionals for the element to ignore. For example, given the QName Path “a/b/c”, where <a> is being mapped as a feature, then only <c> elements with a <b> parent will be ignored.
XSD Types as Attributes to Ignore
Specifies a white-space-separated list of complex type definition QNames. Element declarations in the XSD Schema whose type matches or extends any of the listed type definitions will be ignored.
Max Attributes Per Nested Attribute
Limits the number of FME nested attributes that an XML element and its children are mapped into. If the specified limit is reached, then the XML element is simply mapped into an XML fragment.
Settings
XML Namespace Declarations
The legal values for this parameter are white-space-separated XML namespace declarations as they would appear in an XML element.
This parameter allows different namespace declarations to be used, other than the ones extracted from the parsed XSD documents.
Add XML Namespace Prefix To
The FME feature type and/or attribute names may include the XML Namespace prefixes used in the XSD Schemas. The prefix will be separated from the names by an underscore.
By default, the prefixes are not added to the names.
- Feature Types – Includes the prefixes in the feature types. Setting this parameter to Feature Types is necessary if the XSD Schemas contains feature types with the same name in different namespaces.
- Feature Types and Attributes – Includes the prefixes in both the feature types and attributes.
Custom xsi:schemaLocation
By default, the writer does not create an xsi:schemaLocation attribute.
This parameter allows a custom xsi:schemaLocation attribute to be set for output. The value for this parameter must be whitespace-separated namespace-URI and xsd-location-URL pairs, following the same syntax as the xsi:schemaLocation attribute.
Validate Dataset
Determines whether the reader should validate the written file against the XSD Schema.
XML Appender
These parameters provide additional options for constructing a final XML document that may not necessarily be handled through the writer’s feature mapping.
This parameter may be used to optionally specify the XML document that is to be written out as output. Any XML element created from a rooted feature by the writer will be inserted into this document. By default, the XML elements are inserted right before the end tag of the XML document’s root element.
This parameter specifies a single element via a QName, or a path to a single element via a path of QNames, in the XML Document.
Each element in the path is separated by a forward slash (/). An asterisk wildcard (*) may also be used as the prefix or local-name of the element’s QName. For example, *:e, p:*, or just * (which is a shorter version of *:*).
This parameter specifies a single insertion point in the XML Document. To append into multiple sections, use the xml_document_append_path format attribute, this format attribute overrides this parameter if present.
This parameter controls how the features that are mapped into XML are inserted into the XML Document in relation to the XML Document Append Path.
The possible values for the parameter are:
- Succeeding Children (default)
- Preceding Children
- Preceding Siblings
- Succeeding Siblings
The values are to be understood in relation to the selected or matched element.
Each individual root feature may override this parameter by using the xml_document_append_as format attribute. The possible values for xml_document_append_as are preceding_children, succeeding_children, preceding_siblings, and succeeding_siblings.
This parameter may be used to optionally specify a wrapper XML fragment for the XML elements that are created from the XSD Schema.
Each individual feature may override this parameter by using the xml_wrapper format attribute.
This parameter specifies a single element via a QName, or a path to a single element via a path of QNames, in the XML Fragment.
Each individual feature may override this parameter by using the xml_wrapper_append_path format attribute.
This parameter controls how the features that are mapped into XML are inserted into the XML Wrapper in relation to the XML Wrapper Append Path.
The possible values for the parameter are:
- Succeeding Children (default)
- Preceding Children
- Preceding Siblings
- Succeeding Siblings
The values are to be understood in relation to the selected or matched element.
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd"> <gmd:hierarchyLevel> <gmd:MD_ScopeCode codeList="" codeListValue="">dataset</gmd:MD_ScopeCode> </gmd:hierarchyLevel> … By default XML elements are inserted here … </gmd:MD_Metadata>
If the Feature Paths parameter is set to map gmd:DQ_DataQuality, then the writer will generate a <gmd:DQ_DataQuality> fragment from a feature and insert before the end of the <gmd:MD_Metadata> tag.
It is also possible to wrap the generated <gmd:DQ_DataQuality> in another xml wrapper fragment by using the XML Wrapper parameter. If XML Wrapper has the <gmd:dataQualityInfo/> fragment, the generated <gmd:DQ_DataQuality> will be appended before the end tag of <gmd:dataQualityInfo>, the <gmd:dataQualityInfo> will be appended before the end tag of <gmd:MD_Metadata>:
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd"> <gmd:hierarchyLevel> <gmd:MD_ScopeCode codeList="" codeListValue="">dataset</gmd:MD_ScopeCode> </gmd:hierarchyLevel> <gmd:dataQualityInfo> <gmd:DQ_DataQuality> … contents generated by the XSD Driven XML writer … </gmd:DQ_DataQuality> </gmd:dataQualityInfo> </gmd:MD_Metadata>
Each individual root feature may override this parameter by using the xml_document_append_as format attribute. The possible values for xml_document_append_as are preceding_children, succeeding_children, preceding_siblings, and succeeding_siblings.
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.