WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:xpath
Description:The active:xpath service performs an xpath operation on an XML document and returns the result.
Id:apache.XPath1
Category:accessor
Identifier Syntax

xpath is an accessor using Active URI syntax with the following base identifiers:

Base
active:xpath

and the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
operand
Mandatory
Representation (DOM)XML document to which the XPath expression is applied
operator
Mandatory
Representation (java.lang.String)XPath 1.0 expression
Request Verbs

The following verb is supported:

Verb
SOURCE
Response

The following response representations can be returned for SOURCE requests:

SOURCE Representations
DOMjava.lang.Booleanjava.lang.String

This accessor throws no documented exceptions.

Import Requirements

To use xpath accessor you must import the module urn:org:netkernel:xml:core:

<import>
  <uri>urn:org:netkernel:xml:core</uri>
</import>

When a request with the SOURCE verb is issued to active:xpath the XPath expression specified in the required operator argument is used against the XML document specified in the required operand argument.

The operator argument specifies the XPath 1.0 expression and must be transreptable to a IDeterminateString.

SOURCE

The returned representation depends on the XPath expression. For example:

  • "boolean(/xpath)" returns a java.lang.Boolean
  • "string(/xpath)" returns a java.lang.String
  • "/xpath" returns an org.w3c.dom.Document (DOM Document). The root of the document will be a node named resultset and each resultant fragment will be appended as a child.

See the optional Saxon module for XPath 2.0 support.