XML
- Last UpdatedOct 31, 2025
- 8 minute read
You can extract the XML-specific data (.xml) by defining specific settings for XML data:
To extract the specific settings for XML data:
-
Click XML.
-
Click the Input Source drop-down list.
-
Select the type of Input Source from the drop-down box, that is, File System or S3.
-
Select the "EIWM" checkbox if you want to enable a specialized processing of EIWM as input xml, which then automatically disables the XML configuration path input.
As EIWM files have a specific structure relevant to AIM objects, a specific extraction method should be applied to them to obtain the maximum advantage of the Gateway’s postprocessing functions in transforming Object IDs, and so on.
This also enables the "Ignore File Suffix" option that allows you to specify whether any suffixes in the input file name should be ignored during processing. These suffixes are normally added when the original EIWM file was created, so ignoring them allows the Gateway to treat the contents of the EIWM as if they were extracted from the original input file that was used to create the input EIWM file. The configuration supports a pipe-separated list of suffixes to ignore with Default Value as "_avngate|_null", which ignores suffixes of "_avngate" or "_null".
Configuring File System and S3
For FileSystem

-
Define the Input Path for the location of the relevant input files, either typing directly or use the Browse File Path to select the user input file in the correct format, that is, .xml or select Browse Folder Path to select a folder of files.
-
Browse and select the user input file in the correct format, that is, .xml.
A separate XML configuration file ExtractXMLConfiguration.xml is created automatically in the configurations folder.
-
Edit the XML configuration file and make necessary configuration changes.
-
Save the configuration.
The Extractor configuration is saved to an XML file with a data source section, for example:
<Datasources>
<XML>
<Input source="FileSystem">
<FileSystem>
<InputPath>C:\Users\User_name\Desktop\1D Data Projects\testing\Input\XML\ComponentData.xml</InputPath>
</FileSystem>
</Input>
<ExtractXMLConfigurationPath>C:\Users\ User_name\Desktop\1D Data Projects\testing\Configurations\ExtractXMLConfiguration.xml</ExtractXMLConfigurationPath>
</XML>
</Datasources> -
Click Run to process all the files relevant to the extraction settings in the selected folder and its sub-folders, based on the extractor configuration that has been saved.
For S3
To configure the extractor for S3 bucket as input source:
-
Follow the below procedures for Accessing an AWS S3 Bucket to use the S3 bucket Details.

-
Define the elements in S3 section.
-
Click Test Connection, if you want to test the connection to the S3 bucket. The result of the test is displayed in the status bar.
-
Click Save Settings.
XML Configuration Example with S3 Input Source:
<Datasources>
<XML>
<Input source="S3">
<S3>
<Authentication instanceProfile="false">
<CredentialFile path=" " profileName =" " />
</Authentication>
<Region> </Region>
<BucketName> </BucketName>
<ObjectKey />
</S3>
<FileSystem>
<InputPath>C:\Users\<Gateway User>\Desktop\review\Input\</InputPath>
</FileSystem>
</Input>
<ExtractXMLConfigurationPath> C:\Users\User_Name\Desktop\SubfolderTestProject\
Configurations\ExtractXMLConfiguration.xml </ExtractXMLConfigurationPath>
</XML>
</Datasources>
The Gateway extracts the configuration file containing a specific datasource from S3 repository.
ExtractXMLConfiguration.xml File:
The ExtractXMLConfiguration file reads the Xpaths provided in each of the <objectsPath> nodes, navigates to the particular node in the input XML based on the hierarchy provided in the Xpath and extracts the Internal nodes/Attributes available in that particular selected node.
If you want to extract all the internal nodes of selected node as attributes to the output EIWM file, the following mapping can be used:
<Attributes>
<Attribute value="/*" />
</Attributes>
If you want to extract all the attributes of selected node as attributes to the output EIWM file, the following mapping can be used:
<Attributes>
<Attribute value="/@*" />
</Attributes>
If you want to extract selected attributes/internal nodes of selected node as attributes to the output EIWM file, below mapping can be used:
<Attributes>
<Attribute value="/@Attribute name" />
<Attribute value="/Internal node name" />
</Attributes>
If you want to extract the internal nodes as separate objects with their own attributes, hierarchical mapping can be provided as mentioned below:
<Object>
<objectsPath value="/Plant/Equipments/Equipment" />
<Attributes>
<Attribute value="/@EquipmentID" />
<Attribute value="/*" />
</Attributes>
<Object>
<objectsPath value="/ComponentsPurchased/Component" />
<Attributes>
<Attribute value="/*" />
</Attributes>
</Object>
</Object>
An additional association "is a part of" is added to the object created from Xpath "/ComponentsPurchased/Component" to the parent object created from Xpath "/Plant/Equipments/Equipment" in the output EIWM.Configuring XML Extraction.
XML Extraction Configuration
Overview
The ExtractXMLConfiguration.xml file defines how to extract data from XML files into AVEVA's Engineering Information Workflow Model (EIWM). It specifies XPath expressions to navigate the XML hierarchy and map elements and attributes to objects and their properties.
Basic Configuration Structure
<XmlSettings>
<Objects>
<Object>
<objectsPath value="/Path/To/Element" />
<Attributes>
<Attribute value="/@AttributeName" />
<Attribute value="/ChildElement" />
</Attributes>
</Object>
</Objects>
</XmlSettings>
Element and Attribute Extraction
Extract All Child Elements as Attributes
To extract all child elements of a selected node as attributes:
<Attributes>
<Attribute value="/*" />
</Attributes>
Note: This will extract only elements that do not have any inner XML elements.
Extract All Attributes of a Selected Node
To extract all attributes of a selected node:
<Attributes>
<Attribute value="/@*" />
</Attributes>
Extract Specific Attributes or Child Elements
To extract selected attributes or child elements:
<Attributes>
<Attribute value="/@AttributeName" />
<Attribute value="/ChildElementName" />
</Attributes>
Extract Attribute by Position
To extract a specific attribute by position (e.g., the second attribute):
<Attributes>
<Attribute value="/@*[2]" />
</Attributes>
Hierarchical Mapping (Nested Objects)
To extract nested objects with their own attributes and create parent-child relationships:
<Object>
<objectsPath value="/Plant/Equipments/Equipment" />
<Attributes>
<Attribute value="/@EquipmentID" />
<Attribute value="/*" />
</Attributes>
<Object>
<objectsPath value="/ComponentsPurchased/Component" />
<Attributes>
<Attribute value="/*" />
</Attributes>
</Object>
</Object>
This creates an association "is a part of" from the child object to its parent.
Handling XML Namespaces
XML documents often contain namespaces which must be handled properly for successful extraction. There are several approaches:
-
Using Namespace Prefixes
For XML with explicit namespace prefixes:
<!-- Input XML -->
<ns:Plant xmlns:ns="http://example.com/ns">
<ns:Equipment id="E1">
<ns:Name>Pump</ns:Name>
</ns:Equipment>
</ns:Plant>
<!-- Configuration -->
<Object>
<objectsPath value="/ns:Plant/ns:Equipment" />
<Attributes>
<Attribute value="/@id" />
<Attribute value="/ns:Name" />
</Attributes>
</Object>
The extractor automatically creates a namespace manager to handle prefixed elements.
-
Using local-name() Function (Namespace-Agnostic)
For XML with default namespaces or when you want namespace-agnostic extraction:
<!-- Input XML with default namespace -->
<Plant xmlns="http://example.com/ns">
<Equipment id="E1">
<Name>Pump</Name>
</Equipment>
</Plant>
<!-- Configuration -->
<Object>
<objectsPath value="/*[local-name()='Plant']/*[local-name()='Equipment']" />
<Attributes>
<Attribute value="/@id" />
<Attribute value="/*[local-name()='Name']" />
</Attributes>
</Object>
-
Mixed Namespace Handling
For XML with multiple namespaces:
<!-- Input XML with multiple namespaces -->
<root xmlns:ns1="http://ns1.example.com" xmlns:ns2="http://ns2.example.com">
<ns1:Equipment>
<ns2:Component id="C1">
<ns1:Detail>Test</ns1:Detail>
</ns2:Component>
</ns1:Equipment>
</root>
<!-- Configuration -->
<Object>
<objectsPath value="/root/*[local-name()='Equipment']/*[local-name()='Component']" />
<Attributes>
<Attribute value="/@id" />
<Attribute value="/*[local-name()='Detail']" />
</Attributes>
</Object>
-
Attribute Selection with Namespaces
For attributes with namespaces:
<!-- Input XML -->
<Equipment xmlns:spec="http://specs.example.com">
<Details spec:category="Pump" spec:rating="High" />
</Equipment>
<!-- Configuration -->
<Object>
<objectsPath value="/ns:Equipment/ns:Details" />
<Attributes>
<Attribute value="/@spec:category" />
<Attribute value="/@spec:rating" />
</Attributes>
</Object>
Advanced XPath Features
-
Conditional Selection
To select elements based on attribute values:
<Object>
<objectsPath value="/Inventory/Product[@category='Electronics' and @Available='true']" />
<Attributes>
<Attribute value="/@id" />
<Attribute value="/Price/@currency" />
</Attributes>
</Object>
-
Attribute Condition with local-name()
To select elements with specific attributes while being namespace-agnostic:
<Object>
<objectsPath value="/*[local-name()='Equipment' and @EquipmentID='E1']/*[local-name()='SubEquipmentsList']" />
<Attributes>
<Attribute value="/*" />
</Attributes>
</Object>
-
Using XPath Functions
The extractor supports various XPath functions:
<!-- Using starts-with() -->
<Object>
<objectsPath value="/SubEquipmentsList/*[starts-with(name(), 'Sube')]" />
<Attributes>
<Attribute value="/@subID" />
</Attributes>
</Object>
<!-- Using contains() -->
<Object>
<objectsPath value="/List/*[contains(name(), 'ForTest')]" />
<Attributes>
<Attribute value="/@id" />
</Attributes>
</Object>
-
Position-based Selection
To select elements by position:
<Object>
<objectsPath value="/Root/Items/Item[2]" />
<Attributes>
<Attribute value="/." /> <!-- Extract element text value -->
</Attributes>
</Object>
Example
Here's a comprehensive example demonstrating multiple namespace handling techniques:
<!-- XML Input Example -->
<root xmlns="http://default.namespace.com"
xmlns:prod="http://products.example.com"
xmlns:spec="http://specs.example.com">
<prod:Equipment id="E1">
<prod:Name>Centrifugal Pump</prod:Name>
<spec:Details rating="High" material="Steel"/>
<ComponentsPurchased>
<Component id="C1">
<ComponentID>C1</ComponentID>
<ComponentName>Impeller</ComponentName>
</Component>
</ComponentsPurchased>
</prod:Equipment>
</root>
<!-- ExtractXMLConfiguration.xml -->
<XmlSettings>
<Objects>
<!-- Using namespace prefixes -->
<Object>
<objectsPath value="/ns:root/prod:Equipment" />
<Attributes>
<Attribute value="/@id" />
<Attribute value="/prod:Name" />
<Attribute value="/spec:Details/@rating" />
<Attribute value="/spec:Details/@material" />
</Attributes>
<!-- Using local-name() for default namespace -->
<Object>
<objectsPath value="/*[local-name()='ComponentsPurchased']/*[local-name()='Component']" />
<Attributes>
<Attribute value="/@id" />
<Attribute value="/*[local-name()='ComponentID']" />
<Attribute value="/*[local-name()='ComponentName']" />
</Attributes>
</Object>
</Object>
</Objects>
</XmlSettings>
The above settings produce a couple of EIWM objects. One of them is Equipment containing
characteristics as xml attribute ‘id’, xml element ‘Name’, xml attributes ‘rating’ and ‘material’ from xml element ‘Details’. Other is ComponentsPurchased containing characteristics as xml attribute ‘id’, xml element ‘ComponentID’ and xml element ‘ComponentName’. Here is the output EIWM.
<Object>
<ID>E1</ID>
<Context>
<ID>Avngate</ID>
</Context>
<ClassID>Centrifugal Pump</ClassID>
<Association type="is referenced in">
<Object>
<ID>ComponentData</ID>
<Context>
<ID>Avngate</ID>
</Context>
<ClassID>Document</ClassID>
</Object>
</Association>
<Characteristic>
<Name>id</Name>
<Value>E1</Value>
</Characteristic>
<Characteristic>
<Name>Name</Name>
<Value>Centrifugal Pump</Value>
</Characteristic>
<Characteristic>
<Name>rating</Name>
<Value>High</Value>
</Characteristic>
<Characteristic>
<Name>material</Name>
<Value>Steel</Value>
</Characteristic>
</Object>
<Object>
<ID>C1</ID>
<Context>
<ID>Avngate</ID>
</Context>
<ClassID>UNKNOWN</ClassID>
<Association type="is a part of">
<Object>
<ID>E1</ID>
<Context>
<ID>Avngate</ID>
</Context>
<ClassID>Centrifugal Pump</ClassID>
</Object>
</Association>
<Association type="is referenced in">
<Object>
<ID>ComponentData</ID>
<Context>
<ID>Avngate</ID>
</Context>
<ClassID>Document</ClassID>
</Object>
</Association>
<Characteristic>
<Name>id</Name>
<Value>C1</Value>
</Characteristic>
<Characteristic>
<Name>ComponentID</Name>
<Value>C1</Value>
</Characteristic>
<Characteristic>
<Name>ComponentName</Name>
<Value>Impeller</Value>
</Characteristic>
</Object>
Postprocessing of EIWM Files
The Gateway uses the postprocessing functions by applying specific extraction method on the EIWM files.

This will add the following additional settings in the Extract Configuration file:

After the extraction all the parameters in the EIWM file will be available for further transformations via Base Mappings. For example, the following would modify the ObjectID using an Excel lookup. If no mappings are applied, the output EIWM will be same as the input EIWM.

Note:
-
As with normal Gateway processing, by default, the output filename is appended with "_avngate" (if the Conext is not defined) or "_null" (if the Context is defined). This means that if the "Ignore File Suffix" option has not been configured then the output EIWM file may have two suffixes.
-
If the input EIWM objects have a ContextID defined and you want to replace this value with a default Context defined in the EIWM Load configuration, you also need to set the ‘override’ option to ‘true’ in the LoadEIWMConfiguration.xml, as the default Context is normally only applied to objects that don’t already have a ContextID defined.
-
Input EIWM must have at least a blank ID node under each Object node.
-
During EIWM processing, if the input EIWM contains a Manifest object this is treated as a normal EIWM Object. Hence any updates to the Manifest object can be configured similar to other object mappings.