Skip to content

XML loader

Basics

The XML loader allows you to access elements or attributes of the input XML the following way.

Let's take an example XML:

<complexobject>
  <someobject>
    <something>duh</something>    
  </someobject>
  <elements>
    <item id="id01">
      <data>
        <value>Hello</value>
        <index>1</index>
      </data>
      <details>
        <detail>a</detail>
        <detail>b</detail>
      </details>
    </item>
    <item id="id02">
      <data>
        <value>Goodbye</value>
        <index>2</index>
      </data>
    </item>
  </elements>
</complexobject>

If your parser takes item as root, then two sets of data will be generated (one for every element named item in the example above):

The first element will contain the following fields/values :

  • item[id] = "id01"
  • item>data>value = "Hello"
  • item>data>index = 1
  • item>details>detail = ["a","b"] (multivalued - see note below)

And the second element :

  • item[id] = "id02"
  • item>data>value = "Goodbye"
  • item>data>index = 2

Multivalued fields

Note that in the first element, the field item>details>detail will be multivalued, meaning that if you use it in your template, the related entity may be cloned.