Sometimes, the name of an XML node can contains itself data information.

In this case, the name of the node will vary on each file, on each occurrence or execution.

The Stambia's XML technology offers the possibility to read easily this kind of nodes by specifying a name pattern in the XML Metadata.

For instance, the name of the node below is the name of the person:

<mgt:hotelManagement xmlns:com="http://stambia.org/samples/common" xmlns:mgt="http://stambia.org/samples/management" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <GIBBS customerId="1" firstName="Jason" lastName="GIBBS" titleCode="Mr"/>
    <JIMENEZ customerId="3" firstName="Tony" lastName="JIMENEZ" titleCode="Mr"/>
    <HAMPTON customerId="4" firstName="Lionel" lastName="HAMPTON" titleCode="Mr"/>
</mgt:hotelManagement>

 

Prerequisites:
  • Stambia DI Designer S18.3.0 or higher
  • Stambia DI Runtime S17.4.0 or higher

 

Metadata Configuration

To read XML files containing nodes with varying names, simply:

  1. Open the Metadata
  2. Navigate to the node
  3. Set its Name Selection Pattern

 

 metadata

 

This parameter is waiting for a regular expression.

At read, if the name corresponds to the regex specified here, the Runtime will load the node.

That's all, you're ready to load nodes with dynamic names!

Refer to this article if you want to learn how to retrieve the name of the node, for instance.