Writer Directives

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

The GML writer may either write to an existing GML Application Schema, or output a dataset and a schema document corresponding to the GML writer’s DEF lines.

To write to an existing GML Application Schema the writer’s PROFILE directive must be set to GENERIC_APPLICATION_SCHEMA. In this mode, the GML writer will write a single dataset file corresponding to an existing GML Application Schema. The GML Application Schema file is then specified via the XSD_DOC directive. The value for the XSD_DOC directive should be an existing schema, say a full path to “AIXM_BasicMessage.xsd” the schema for AIXM v5.1. The writer feature type definitions must then match the ones from the schema. Importing the feature type definitions from the GML reader with the same GML Application Schema will bring in the valid writer feature type definitions.

To write out a new .xsd that is solely controlled by the writer’s DEF lines, i.e., the feature type definitions, the PROFILE directive should be set to either GENERIC_3.1.1 or GENERIC_3.2.1.

Two XML documents are written, a GML instance and its corresponding GML application schema. The GML application schema structure is controlled by the GML writer’s DEF lines.

Multiple geometrical property elements can be written per feature type definition. The name and the position for these geometric elements can also controlled through the GML writer’s feature type definitions.

Complex non-geometrical properties are supported in this release. These are to be specified in the GML Writer DEF lines as FME structured attributes. Each component in a structured attribute is separated by a period, “.”, and each component may also be a list, specified by the “{}” token. Attributes that are lists will be mapped into GML property declarations having a maxOccurs of unbounded. For example, the structured FME attributes, “changeHistory.Date”, and “changeHistory.Reason” are represented in the GML instance as: “<changeHistory><Date>...</Date><Reason>...</Reason></changeHistory>”.

Currently, only simple GML geometries, i.e., geometries with linear interpolation, are supported in this release.

DATASET

Required/Optional: Required

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

Example:

GML_DATASET c:\gml\data.xml

Workbench Parameter: Destination Geography Markup Language (GML) File

PROFILE

The GML writer can write a dataset according to an existing GML Application Schema or create the GML Application Schema along with the written dataset.

The GENERIC_APPLICATION_SCHEMA option is used in conjunction with the XSD_DOC directive. This GENERIC_APPLICATION_SCHEMA mode allows the writer to write GML datasets according to existing GML based standard formats such as AIXM v5.1 or INSPIRE.

The XSD_DOC directive is used to specify appropriate XML Schema document.

Setting the directive to either GENERIC_3.1.1 or GENERIC_3.2.1 instructs the writer to create an XSD that is based on the writer DEF lines. A new XSD document will be created every time. The GML writer will not write to an existing GML based standard such as AIXM v5 or INSPIRE in this mode.

Values

GENERIC_3.1.1 (default) | GENERIC_3.2.1 | GENERIC_APPLICATION_SCHEMA

Mapping File Syntax

GML_PROFILE GENERIC_3.2.1

Required/Optional

Required

Workbench Parameter

GML Version

WRITE_ALL_FEATURE_TYPE_DEFNS

Required/Optional: Optional

Example:

GML_WRITE_ALL_FEATURE_TYPE_DEFNS NO

Workbench Parameter: Write All Feature Types

TARGET_NS_PREFIX

Required/Optional: Optional

Example:

GML_TARGET_NS_PREFIX ns

Workbench Parameter: Target Namespace Prefix

TARGET_NS_URI

Required/Optional: Optional

The directive specifies the GML application schema target namespace URI. The default value for this directive is
http://www.safe.com/gml/fme.

Example:

GML_TARGET_NS_URI http://www.contrivedurl.com/ns

Workbench Parameter: Target Namespace URI

XSD_DOC

If PROFILE is GENERIC_3.1.1 or GENERIC_3.1.1, then this is the file location for the output GML application document. If left blank, then the .xsd file will be created in the same folder and with the same file basename as the output dataset.

This directive is required if PROFILE is GENERIC_APPLICATION_SCHEMA. The directive specifies the file location for the existing GML Application Schema. The GML writer will parse this schema and write out features according to the feature types found in the schema. No other feature types, except the ones specified in the schema, will be written.

The writer feature type definitions, i.e., the DEF lines, must then match the ones from the schema. Importing the feature type definitions from the GML reader with the same GML Application Schema will bring in the valid writer feature type definitions.

The GML reader dataset may be left unset when importing feature type definitions to the writer.

Required/Optional

Optional | Required if PROFILE is GENERIC_APPLICATION_SCHEMA

Workbench Parameter

Application Schema

OUTPUT_ENCODING

Required/Optional: Optional

The directive specifies the encoding to use for the output XML documents, which include both the GML instance and the GML application schema. The default value for this directive is UTF-8.

Example:

GML_OUTPUT_ENCODING ISO-8891-1

Workbench Parameter: Output Encoding

SYSTEM_ENCODING

Required/Optional: Optional

Example:

GML_SYSTEM_ENCODING UTF-8

Workbench Parameter: System encoding

SUPPRESS_XSI_SCHEMALOCATION

Required/Optional: Optional

Example:

GML_SUPPRESS_XSI_SCHEMALOCATION YES

Workbench Parameter: Suppress xsi:schemaLocation attribute

FEATURE_COLLECTION

Values

gml (default) | target-namespace | wfs

Mapping File Syntax

GML_FEATURE_COLLECTION target-namespace

Required/Optional

Optional

Workbench Parameter

Feature Collection

FEATURE_COLLECTION_ID

Mapping File Syntax

GML_FEATURE_COLLECTION_ID my-id-001

Required/Optional

Optional

Workbench Parameter

Feature Collection ID

TARGET_XSI_SCHEMALOCATION_URL

Required/Optional: Optional

By default, the URL for the target namespace URI - URL location pair in the instance document’s xsi:schemaLocation attribute is the GML application schema’s relative filename. This directive allows the user to overwrite the .xsd filename by supplying a custom URL. The directive only affects the value of the URL for the target namespace in the xsi:schemaLocation. It does not affect where the application schema will be written (for this, see the XSD_DOC directive). The directive should have exactly one URL value indicating the XSD location for the target namespace URI.

If the directive has multiple values, then they must be whitespace-separated URI–URL pairs. This option allows the user to provide a complete custom xsi:schemaLocation for the output document.

Example:

GML_TARGET_XSI_SCHEMALOCATION_URL http://www.conurl/ns.xsd

Workbench Parameter: Target xsi:schemaLocation URL

SRS_NAME

Required/Optional: Optional

Example:

GML_SRS_NAME urn:ogc:def:crs:EPSG:6.6:4326

Workbench Parameter: GML srsName

SRS_AXIS_ORDER

Required/Optional: Optional

GML_SRS_AXIS_ORDER 2,1

Workbench Parameter: GML SRS Axis Order

PRETTY_PRINT

Required/Optional: Optional

GML_PRETTY_PRINT YES

Workbench Parameter: Pretty Print

INDENT_SIZE

Required/Optional: Optional

GML_INDENT_SIZE 3

Workbench Parameter: Indent Size

REPLACE_TABS_WITH_SPACES

Required/Optional: Optional

GML_REPLACE_TABS_WITH_SPACES YES

Workbench Parameter: Replace Tabs with Spaces

TEXT_INDENT

Required/Optional: Optional

TEXT_INDENT NO

Workbench Parameter: Indent Text

MAXIMUM_FRACTION_DIGITS

Required/Optional: Optional

Workbench Parameter: Maximum Decimal Places

MINIMUM_FRACTION_DIGITS

Required/Optional: Optional

Workbench Parameter: Minimum Decimal Places

APPLY_STYLESHEET

Required/Optional: Optional

Example:

GML_APPLY_STYLESHEET c:\data\myTransform.xsl

Workbench Parameter: XSLT Style Sheet to Apply

STYLESHEET_RESULT

Required/Optional: Optional

Example:

GML_STYLESHEET_RESULT c:\data\myTransformedDoc.xml

Workbench Parameter: Style Sheet Result

USE_STYLESHEET_RESULT_AS_DATASET

Values

YES | NO (default)

Mapping File Syntax

GML_USE_STYLESHEET_RESULT_AS_DATASET Yes

Required/Optional

Optional

Workbench Parameter

Dataset as stylesheet result

VALIDATE_OUTPUT_DATASET

This directive controls validation of the output file against the schemas referenced in that file.

If APPLY_STYLESHEET is specified, the result of applying the stylesheet is validated. Otherwise, the DATASET is validated.

Values

YES | NO (default)

Mapping File Syntax

GML_VALIDATE_OUTPUT_DATASET Yes

Required/Optional

Optional

Workbench Parameter

Validate GML Dataset File

OVERRIDE_XSD_AND_USE_NAMESPACE_DECLARATIONS

Mapping File Syntax

GML_OVERRIDE_XSD_AND_USE_NAMESPACE_DECLARATIONS xmlns:pfx=”…some namespace uri…” xmlns:pfx2=”…some namespace uri…”

Required/Optional

Optional

Workbench Parameter (under Advanced parameters in the Navigator)

Override XSD And Use Namespace Declarations

DOCUMENTS_TO_WRITE

Required/Optional

Optional

Workbench Parameter

BOTH (default) | GML_ONLY | XSD_ONLY