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

Note  At least one of the Application Schema and/or xsi:schemaLocation parameters must be set.

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.

Tip  For an in-depth guide on how to use these parameters, please see Composing XML Documents using the XML Appender Parameters in the XSD-Driven XML Writer.

Pretty Printing