×
Menu
Index

Syntax

 

Introduction

To address an element we use the following syntax:
 
RootElement/SubElementA/SubElementB/SubElementC
 
We address:
 
<RootElement>
<SubElementA>
<SubElementB>
<SubElementC>Value</SubElementC>
</SubElementB>
</SubElementA>
</RootElement>
 

Instance

Suppose we want to address SubElementC in the Second SubElementA, third ElementB?
 
<RootElement>
<SubElementA>
<SubElementB>
<SubElementC>Value1</SubElementC>
</SubElementB>
</SubElementA>
<SubElementA>
<SubElementB>
<SubElementC>Value2</SubElementC>
</SubElementB>
<SubElementB>
<SubElementC>Value3</SubElementC>
</SubElementB>
<SubElementB>
<SubElementC>Value4</SubElementC>
</SubElementB>
</SubElementA>
</RootElement>
 
The syntax will be:
 
RootElement/SubElementA{2}/SubElementB{3}/SubElementC
 
Attention!
If no instance is used, instance 1 will be supposed.
 
The upper example is the same as:
RootElement{1}/SubElementA{2}/SubElementB{3}/SubElementC
 
 

Variables

You can also use variables as an instance indicator.
Example:
 
#ElementACounter = 2
#ElementBCounter = 3
 
RootElement/SubElementA{[#ElementACounter]}/SubElementB{[#ElementBCounter]}/SubElementC
 
Also a part of the path can be used from a variable. Example:
 
#PathToElementA = RootElement/SubElementA{2}
 
[#PathToElementA]/SubElementB{[#ElementBCounter]}/SubElementC
 
 

Relative paths

If we want to address an element relative to our current path (our context), we can use relative paths. There are 2 possibilities:
 
.
 
We address relative to our current path (context). Suppose our location is a  SubElementA (it can be the first or the second, that doesn't matter using relative paths). We can use the following to address SubElementC
 
./SubElementB{3}/SubElementC
 
..
 
We address relative to the parent of our current element. Suppose we are at SubElementB{2} en we want to address SubElementB{3}/SubElementC. The syntax will be:
 
../SubElementB{3}/SubElementC
 
You can use multiple .. by placing / between them. Suppose we are at SubElementB{2} van SubElementA{2} and we want to address SubElementA{1}/SubElementB/SubElementC, the syntax will be:
 
../../SubElementA{1}/SubElementB/SubElementC