---
title: "Syntax of Location Paths"
slug: "guide/web-service-interfaces/application-specific-data/location-paths/syntax-of-location-paths"
sidebar:
  order: 102
---

<a id="ref-f3ecf06e793a"></a>
<a id="ref-15984d8b507c"></a>
<a id="ref-8acc12a46cc9"></a>

Location paths supported by the operations that set and get application data are a very limited declarative[^1] subset of XPath location paths. They must adhere to the following grammar:

## Synopsis

<table aria-label="Synopsis">
<thead><tr><th scope="col">Rule</th><th scope="col">Operator</th><th scope="col">Expression</th></tr></thead>
<tbody>
<tr><th scope="row" id="grammar-locationpath">LocationPath</th><td>::=</td><td><a href="#grammar-elementtest">ElementTest</a>  (  &#x27;/&#x27;  <a href="#grammar-elementtest">ElementTest</a>  )*  (  &#x27;/&#x27;  <a href="#grammar-attributetest">AttributeTest</a>  )?</td></tr>
<tr><th scope="row" id="grammar-elementtest">ElementTest</th><td>::=</td><td><a href="#grammar-ncname">NCName</a>  <a href="#grammar-predicate">Predicate</a>?</td></tr>
<tr><th scope="row" id="grammar-attributetest">AttributeTest</th><td>::=</td><td><a href="#grammar-attributeref">AttributeRef</a></td></tr>
<tr><th scope="row" id="grammar-predicate">Predicate</th><td>::=</td><td>&#x27;[&#x27;  <a href="#grammar-predicateexpr">PredicateExpr</a>  &#x27;]&#x27;</td></tr>
<tr><th scope="row" id="grammar-predicateexpr">PredicateExpr</th><td>::=</td><td><a href="#grammar-andexpr">AndExpr</a></td></tr>
<tr><th scope="row" id="grammar-andexpr">AndExpr</th><td>::=</td><td><a href="#grammar-equalityexpr">EqualityExpr</a>  (  &#x27;and&#x27;  <a href="#grammar-equalityexpr">EqualityExpr</a>  )*</td></tr>
<tr><th scope="row" id="grammar-equalityexpr">EqualityExpr</th><td>::=</td><td><a href="#grammar-functioncall">FunctionCall</a></td></tr>
<tr><th scope="row"></th><td>|</td><td><a href="#grammar-attributeref">AttributeRef</a>  &#x27;=&#x27;  <a href="#grammar-primaryexpr">PrimaryExpr</a></td></tr>
<tr><th scope="row" id="grammar-functioncall">FunctionCall</th><td>::=</td><td>&#x27;not&#x27;  &#x27;(&#x27;  <a href="#grammar-attributeref">AttributeRef</a>  &#x27;)&#x27;</td></tr>
<tr><th scope="row" id="grammar-attributeref">AttributeRef</th><td>::=</td><td>&#x27;@&#x27;  <a href="#grammar-ncname">NCName</a></td></tr>
<tr><th scope="row" id="grammar-primaryexpr">PrimaryExpr</th><td>::=</td><td><a href="#grammar-literal">Literal</a></td></tr>
<tr><th scope="row"></th><td>|</td><td><a href="#grammar-number">Number</a></td></tr>
<tr><th scope="row" id="grammar-ncname">NCName</th><td>::=</td><td><a href="#grammar-ncnamestartchar">NCNameStartChar</a>  <a href="#grammar-ncnamechar">NCNameChar</a>*</td></tr>
<tr><th scope="row" id="grammar-ncnamestartchar">NCNameStartChar</th><td>::=</td><td>[A-Z]  |  &quot;_&quot;  |  [a-z]  |  [#xC0-#xD6]  |  [#xD8-#xF6]  |  [#xF8-#x2FF] | [#x370-#x37D]  |  [#x37F-#x1FFF]  |  [#x200C-#x200D]  | [#x2070-#x218F]  |  [#x2C00-#x2FEF]  |  [#x3001-#xD7FF]  | [#xF900-#xFDCF]  |  [#xFDF0-#xFFFD]  |  [#x10000-#xEFFFF]</td></tr>
<tr><th scope="row" id="grammar-ncnamechar">NCNameChar</th><td>::=</td><td><a href="/pCon/configuratorOnline/specs/guide/web-service-interfaces/web-service-definition-syntax/names#ref-80e6821b7f16">NameStartChar</a></td></tr>
<tr><th scope="row"></th><td>|</td><td>&quot;-&quot;  |  &quot;.&quot;  |  [0-9]  |  #xB7  |  [#x0300-#x036F]  |  [#x203F-#x2040]</td></tr>
<tr><th scope="row" id="grammar-literal">Literal</th><td>::=</td><td>&#x27;&quot;&#x27;  [^&quot;&#x27;]*  &#x27;&quot;&#x27;</td></tr>
<tr><th scope="row"></th><td>|</td><td>&#x27;&#x27;&#x27;  [^&#x27;]*  &#x27;&#x27;&#x27;</td></tr>
<tr><th scope="row" id="grammar-number">Number</th><td>::=</td><td>[+-]?  <a href="#grammar-digits">Digits</a>  (  &#x27;.&#x27;  <a href="#grammar-digits">Digits</a>?  )?</td></tr>
<tr><th scope="row"></th><td>|</td><td>[+-]?  &#x27;.&#x27;  <a href="#grammar-digits">Digits</a></td></tr>
<tr><th scope="row" id="grammar-digits">Digits</th><td>::=</td><td>[0-9]+</td></tr>
</tbody>
</table>

Whithin literals, the delimiting character (QUOTATION MARK or APOSTROPHE) and AMPERSAND (&) must be represented by character references. The value of a numeric character reference must represent the code point of a valid XML character.

## Synopsis

<table aria-label="Synopsis">
<thead><tr><th scope="col">Rule</th><th scope="col">Operator</th><th scope="col">Expression</th></tr></thead>
<tbody>
<tr><th scope="row" id="grammar-characterreference">CharacterReference</th><td>::=</td><td><a href="#grammar-numericcharacterreference">NumericCharacterReference</a></td></tr>
<tr><th scope="row"></th><td>|</td><td>&#x27;&amp;amp;&#x27;  |  &#x27;&amp;quot;&#x27;  |  &#x27;&amp;apos;&#x27;  |  &#x27;&amp;lt;&#x27;  |  &#x27;&amp;gt;&#x27;</td></tr>
<tr><th scope="row" id="grammar-numericcharacterreference">NumericCharacterReference</th><td>::=</td><td> &#x27;&amp;&#x27;  [0-9]+  &#x27;;&#x27;</td></tr>
<tr><th scope="row"></th><td>|</td><td>&#x27;&amp;x&#x27;  [0-9A-Fa-f]+  &#x27;;&#x27;</td></tr>
<tr><th scope="row" id="grammar-xmlcharacter">XMLCharacter</th><td>::=</td><td>#09  |  #0A  |  #0D  |  [#0020-#D7FF]  |  [#E000-#FFFD]</td></tr>
<tr><th scope="row"></th><td>|</td><td>[#10000-#10FFFF]</td></tr>
</tbody>
</table>

White space (SPACE, CHARACTER TABULATION, LINE FEED and CARRIAGE RETURN) is allowed between individual grammar symbols except within the productions of NCName, Literal, Number and NumericCharacterReference.

## Synopsis

<table aria-label="Synopsis">
<thead><tr><th scope="col">Rule</th><th scope="col">Operator</th><th scope="col">Expression</th></tr></thead>
<tbody>
<tr><th scope="row" id="grammar-whitespace">WhiteSpace</th><td>::=</td><td>#x20 | #x09 | #x0A | #x0D</td></tr>
</tbody>
</table>

[^1]: Location paths used by the operations that set and get application data are declarative because each step of the location path can not only be used to match against existing nodes, but must also declare how to insert a new node if no match is found (operations that set application data must be able to create nodes). In XPath, a relative location path consisting of a single step may look like `Foo[@bar!='abc']`. If this syntax would be supported by operations that set application data, and the application data does not contain a matching node, the operation would have to create a new node, but would not know which value to use for the attribute `'bar'`, or whether to add this attribute at all. On the other hand, if the location path is `Foo[@bar='abc' and not(@baz)]`, and the operation does not find a matching node, it knows to create an element named `<Foo>` with an attribute `'bar'` whose value is `'abc'` and without an attribute `'baz'`.
