Show TOC

Binding Path Syntax for XML ModelsLocate this document in the navigation structure

XML models differentiate between attributes and content. XML has no arrays and defines lists as multiple elements with the same name instead. This makes the binding path syntax for XML models more difficult than for JSON or OData models.

For attributes, a special selector using the "@" character exists and "text()" can be used to reference the content text of an element. Lists are referenced by using the path to the multiple element.

Note For the XML model the root must not be included in the path.
<companies>
  <company name="Treefish Inc">
    <info>
       <employees>3</employees>
    </info>
    <contact phone="873">Barbara</contact>
    <contact phone="734">Gerry</contact>
    <contact phone="275">Susan</contact>
  </company>
</companies>

Absolute binding paths within this model:

/company/@name
/company/info/employees

Relative binding paths within the /company context:

@name
info/employees/text()

Relative binding paths within an aggregation binding of /company/contact:

text()
@phone
Note In a similar JSON model you would use /companies/company/locations as binding path for the locations collection. In an XML model the respective collection binding path is: /company/locations/location.