ArborX


<?xpath>

Longname: xpath   Open the Documentation Legend
Released: 7.77a 
Created: 7.77a 
See also: <?xpointer>
XPath in Arbortext APP XML in Arbortext APP XSLT in Arbortext APP

Summary
This keyword is used to call XPath statements in 3B2.
Example extract

The following example illustrates how to use XPath to retrieve the text in the second child tag of the following mark-up:

<authors> <firstname>Bob</firstname> <surname>Harris</surname> <firstname>Fred</firstname> <surname>Mitchell</surname> </authors>

 <?xpath string(/authors/surname[2])>

The above syntax retrieves the text in the second child element. In this case the text that is returned are the surnames of the authors.


Syntax (7.77a)
xpath_expression:b A valid XPath expression.

XPath can be used in Arbortext APP to query and return parts of a document as inline commands, in show strings or in scripts. This keyword is used to call XPath expressions in 3B2. It is possible to use XPath inline to display the results of the expression and it is also possible to pass information to variables and tags using the normal Arbortext APP syntax. An XPath expression is called using the syntax below, where 'expression' is a valid XPath expression:

 <?xpath expression>

Using the above syntax simply outputs the result where the expression is placed. The result of an expression can be assigned to a variable or string in the same way as it would be with show strings, by placing the target before the expression. For example:

 <?xpath ^"string" expression>

The above example passes the result of the XPath expression to a variable called string.

XPath and XPointer expressions can also contain the stream name and context node position, for example:

 stream#xpath 8
 stream#context char pos#xpath 10
 stream#-context node id#xpath 12

Document created on 08-Feb-2003 (revision 1)