Products Downloads


French version


 

Adelia XPATH path

An Adelia XPATH path is a simplified form of the abbreviated XPATH syntax. It can be useful to employ the Adelia XPATH syntax when working with multiple elements. You can use program variables as indexes, rather than building a string in an intermediate alphanumerical variable in which the index variable's value is concatenated.


In addition, Adelia checks the syntax when the program is verified. If the standard XPATH syntax is used in an alphanumerical constant or variable, the syntax is not checked until the instruction is executed.


Example

With Adelia XPATH:

XML_SELECT xml1 /AdelDBG/PgmInfo/Dlls/Dll[WNBVAL]

With standard XPATH:

ALPHA_VAR = '/AdelDBG/PgmInfo/Dlls/Dll[' // WNBVAL //'] '

XML_SELECT xml1 &ALPHA_VAR


Adelia XPATH syntax

This XPATH syntax only uses the following operators:

/

:

sublevel selector.

//

:

descendent selector.

[n]

:

selection index (n= numerical constant or variable).

:

:

for prefixing with a Namespace.

..

:

parent node selector.


Important:

Like standard XPATH syntax, Adelia XPATH syntax is case-sensitive (except for the index variable for multiple elements).


Examples

/RootNode

selects the RootNode root node.



para

selects the current node's para child elements.



para[1]

selects the current node's first para child element.



/doc/chapter[5]/section[2]

selects the second section in chapter five of doc.



chapter//para

selects the para descendents of the current node's chapter child elements.



//para

selects all the para descendents of the document root. Accordingly, all the para elements of the document containing the current node are selected.



//olist/item

selects all the item elements whose parent is olist in the document containing the current node.



..

selects the current node's parent.



../..

selects the current node's grandparent (i.e. the parent's parent).


If Adelia XPATH syntax is too restrictive for the selection operation to be performed, you can use standard XPATH syntax via an alphanumerical constant ('standard XPATH path') or alphanumerical variable (&XPATH_PATH_VAR).


Full details of the XPATH language are available at the following address: https://www.w3.org/TR/xpath-31/.


↑ Top of page

  • Aucune étiquette