Advanced XML / GML writing with Stylesheets

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

This article is intended for users with advanced expertise in XML stylesheets. Stylesheets are one way to write XML or GML to a custom application schema. For an alternative that might be easier for non XML experts please refer to the documentation on writing GML with application schemas or XML with XMLTemplater transformer.

A stylesheet is a form of lookup to map the FME destination schema to the required GML schema. You can find useful examples in one of the FME install folders: C:\Program Files\FME\xml\esf\stylesheets

Applying a Stylesheet

Once created, you can specify the stylesheet to use in:

  • The APPLY_STYLESHEET keyword

http_download_1444329651431_6032.png
The APPLY_STYLESHEET keyword, as described in the help docs

  • The stylesheet setting in the writer parameters (in the Navigator pane in Workbench)

http_download_1444329651607_6032.png
The stylesheet setting in the Navigator pane

  • With an XSLT transformer (FME2009)

http_download_1444329651806_6032.png
The XSLT transformer

XSLTProcessor Transformer

The XSLTProcessor is a transformer that uses an XSL (eXtensible Stylesheet Language) stylesheet to transform an XML document according to the transformation rules in the XSLT. Sources (including the stylesheet) may be either a file path name or a string stored in an attribute. (Note that the transformer asks for the attribute name that stores the file path instead of the file path itself.) It is assumed that you have created (or have access to) an XSLT stylesheet that is applicable to your XML input source.

FME will automatically classify the input source as File Path or String Stream. If you choose Both, then output will result in two forms: one as a file, and another as an attribute value stored in the feature.

The following parameters correspond to File Path and String Stream. You will need to specify one or the other, and both if you selected Both in Result will be stored in attribute(s) as, above.

Result File Attribute Name: Enter a filename for the output file.

Result String Attribute Name: This attribute can be an existing attribute or a new attribute added to the output feature, which contains the transformed document as a string attribute.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.