Skip to main content Skip to complementary content
Close announcements banner

Creating a dynamic XML structure

Create a structure and use the XPath Name to match all possible elements in different input files.

Procedure

  1. Create an XML file with the following content and save it on your machine:
    <root>
    	<level1>
    		<level2/>
    		<level2/>
    	</level1>
    	<level1>
    		<level2/>
    		<level2/>
    	</level1>
    </root>
  2. In Talend Data Mapper, create a structure based on your XML file.
  3. Once the structure is created and opens in the editor, click the Read Only drop-down list and select Editable.
  4. Click the level1 element, scroll down to the XPath Name property and enter child::*.
    This indicates that the level1 structure element can refer to any child element of the root element, regardless of the element name.
  5. Repeat the previous step for the level2 element.

Results

Your structure is created and configured, you can now use it in a map and see how it handles different elements.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!