Writer Directives

The directives processed by the GML2 Writer are listed below. The suffixes shown are prefixed by the current <WriterKeyword> in a mapping file. By default, the <WriterKeyword> for the GML2 writer is GML2.

DATASET

Required/Optional: Required

This directive specifies the location for the output GML instance document.

Example:

GMLSF_DATASET c:\gml\data.xml

SCHEMA_MODE

Required/Optional: Optional

This controls the operation mode of the GML2 writer. The valid values are: FIXED (default) | CREATE | SCAN (not yet implemented)

TARGET_NS_PREFIX

Required/Optional: Optional

This directive is used only in CREATE mode. The GML application schema must declare a target namespace. All elements declared in the schema will reside in this namespace. The directive allows the specification of the target namespace prefix.

The default value for this directive is gml2.

Example:

GML2_TARGET_NS_PREFIX geo

TARGET_NS_URI

Required/Optional: Optional

This directive is used only in the CREATE mode. The GML application schema must declare a target namespace. All elements declared in the schema will reside in this namespace. The directive allows the specification of the target namespace URI.

The default value for this directive is http://www.safe.com/gml2.

Example:

GML2_TARGET_NS_URI http://www.geomaps.com/geo

TARGET_XSI_SCHEMA_LOCATION_URL

Required/Optional: Optional

Example:

GML2_TARGET_XSI_SCHEMALOCATION_URL http://www.sch.org/g.xsd

XSD_DOC

Required/Optional: Required when SCHEMA_MODE is SCAN; optional otherwise

It specifies the location for the GML application schema. This directive is not required in FIXED mode, is optional in CREATE mode, and is required in SCAN mode.

  • CREATE mode: The XSD_DOC directive is optional in this mode. Specifies the location of the GML application schema that is generated. If the XSD_DOC is not specified, then the GML application schema is generated in the folder that is specified by the DATASET directive.
  • SCAN mode: The XSD_DOC directive is required in this mode. Given a GML application schema, the GML2 writer will output a conforming GML instance document.

OUTPUT_ENCODING

Required/Optional: Optional

Example:

GML2_OUTPUT_ENCODING Shift-JIS

FEATURE_ENCODING

Required/Optional: Optional

Example:

GML2_FEATURE_ENCODING Shift-JIS

MAPPING_FILE_ENCODING

Required/Optional: Optional

This directive specifies the encoding of the FME mapping file. When not specified, the FME mapping file is assumed to be encoded in the system’s encoding.

Example:

GML2_MAPPING_FILE_ENCODING ISO-8859-3 

USE_WFS_FEATURE_COLLECTION

Required/Optional: Optional

Setting this directive to YES changes the root element in the output document <wfs:FeatureCollection>. The default value for this directive is NO.

Example:

GML2_USE_WFS_FEATURE_COLLECTION YES

APPLY_STYLESHEET

Required/Optional: Optional

Example:

GML2_APPLY_STYLESHEET c:\data\myTransform.xsl

STYLESHEET_RESULT

Required/Optional: Optional

Example:

GML2_STYLESHEET_RESULT c:\data\myTransformedDoc.xml

SUPPRESS_NULL_ATTRS

Required/Optional: Optional

Example:

GML2_SUPPRESS_NULL_ATTRS YES

XFMAP

Required/Optional: Optional

In CREATE mode, the GML2 writer creates a third document, which is an xfMap that can be used by the XML reader to read back the GML documents output. This is an optional directive, and if it is not specified then the output xfMap will have the same filename as the specified output dataset but having an .xmp file extension. See the XML Reader/Writer chapter for a description of the xfMap.

Example:

GML2_XFMAP C:\tmp\test.xmp

SUPPRESS_XFMAP_OUTPUT

Required/Optional: Optional

In CREATE mode, this optional directive can be used to suppress the creation of the xfMap document. The valid values for this directive are YES and NO, with YES being its default value.

Example:

GML2_SUPPRESS_XFMAP_OUTPUT NO

USE_STYLESHEET_RESULT_AS_DATASET

Required/Optional: Optional

Example:

GML2_USE_STYLESHEET_RESULT_AS_DATASET YES

FME_COORDINATE_SYSTEM_AS_PROPERTY

Required/Optional: Optional

This directive only takes effect in CREATE mode. The valid values for this directive are YES and NO with the default value being NO. If this directive is set to YES, then the GML2 writer will extract the FME coordinate system from a feature into a user-defined property named fme_coordinate_system, i.e., the application schema generated will contain for each feature an extra property named fme_coordinate_system whose value will be the FME coordinate system short name.

Example:

GML2_FME_COORDINATE_SYSTEM_AS_PROPERTY YES

LISTS_IN_MULTI_VALUE_ATTRIBUTES

Required/Optional: Optional

Example:

GML2_LISTS_IN_MULTI_VALUE_ATTRIBUTES YES

MULTI_VALUE_SEPARATOR

Required/Optional: Optional

Example:

GML2_MULTI_VALUE_SEPARATOR |

SUPPRESS_SCHEMA_LOCATION_ATTR

Required/Optional: Optional

Setting this directive to YES suppresses the output of the xsi:schemaLocation attribute in the GML instance’s root element. The xsi:schemaLocation in an XML document instance is not a mandatory attribute – it is merely a hint which an XML processor may choose to ignore. Setting this keyword to YES suppresses the output of the xsi:schemaLocation attribute in the output GML instance. The default value for this directive is NO.

Example:

GML2_SUPPRESS_SCHEMA_LOCATION_ATTR YES

DOCUMENTS_TO_WRITE

Required/Optional

Optional

Workbench Parameter

BOTH (default) | GML_ONLY | XSD_ONLY