XML (Extensible Markup Language) Reader Parameters
The XML Reader works by mapping XML elements into FME features. These mappings are defined by an XML application called xfMap.
By extracting these mapping strategies into an xfMap document, the XML Reader is not tied to any particular XML format. Because of this, the XML Reader can read many disparate XML applications, ranging from GIS data to purchase orders. xfMap is described in more detail in xfMap.
Reader Configuration
Specifies whether to read the XML dataset using an xfMap document or to use an XRS document.
The selected configuration type determines which parameters become available in the dialog.
Sets a limit for the number of data features scanned for determining schema features. This option is useful during workspace generation when processing a very large XML file, and you know that the entire file does not have to be read to completely determine the feature type definitions.
Valid values: any positive number.
Feature Paths Configuration
Specifies which XML elements in the dataset, expressed as xfMap match expressions, should be extracted into features containing XML fragments. Multiple expressions can be separated with whitespace. The fragments are held in non-geometrical FME features under their xml_fragment attribute. For more information about additional attributes added to extracted features, see XFMAP_FEATURE_PATHS, XFMAP_FEATURE_PATHS_EXCEPT.
This parameter is useful for deconstructing large XML documents into parts that may be processed further in XML, XQuery, XSLT or text processing Workbench transformers.
This example extracts the children of the <dc:SearchResults> element from the dataset into XML fragment features:
XML_XFMAP_FEATURE_PATHS “csw:SearchResults/*”
Specifies which XML elements in the dataset, expressed as xfMap match expressions, should be excluded from extraction into features. This parameter is especially useful for match expressions containing wildcard characters. Multiple expressions can be separated with whitespace.
This example excludes extraction of the <csw: metadata> children of the <dc:SearchResults> element from the dataset into XML fragment features:
XML_XFMAP_FEATURE_PATHS_EXCEPT "csw:SearchResults/csw:metadata"
This option allows children of the matched elements to be exposed as attributes on FME Features.
See the Structure Element section in the xfMap documentation for details regarding the options available and more examples.
This option allows children of the matched elements to be extracted as xml fragment attributes.
Other Configurations
Specifies the location of the xfMap document. Multiple xfMaps may be specified here.
Specifies the location of an XRS document. An XRS (XML Reader Switch) document allows the XML Reader to automatically configure itself to read "known" XML datasets without the need to specify the appropriate xfMaps in advance.
Specifies whether the reader should continue to extract features from the XML dataset after encountering a geometrical error.
Schema Attributes
Use this parameter to expose Format Attributes in Workbench when you create a workspace:
- In a dynamic scenario, it means these attributes can be passed to the output dataset at runtime.
- In a non-dynamic scenario where you have multiple feature types, it is convenient to expose additional attributes from one parameter. For example, if you have ten feature types and want to expose the same attribute in each one, it is easier to define it once than it is to set each feature type individually in the workspace.
Using the minimum and maximum x and y parameters, define a bounding box that will be used to filter the input features. Only features that intersect with the bounding box are returned.
If all four coordinates of the search envelope are specified as 0, the search envelope will be disabled.
Select this parameter to remove any portions of exported features outside the area of interest.
The illustration below shows the results of the Search Envelope when Clip to Search Envelope is set to No on the left side and Yes on the right side.
- No: Any features that cross the search envelope boundary will be read, including the portion that lies outside of the boundary.
- Yes: Any features that cross the search envelope boundary will be clipped at the boundary, and only the portion that lies inside the boundary will be read. The underlying function for the Clip to Search Envelope function is an intersection; however, when Clip to Search Envelope is set to Yes, a clip is also performed in addition to the intersection.