selectString. XPath search for a string

^node.selectNumber[XPath-query]

This method returns result of
XPath-query in the scope of specified node, if it is a number. If resulted value is not a number, method returns exception of type parser.runtime.

Before using prefixes of name spaces in the query one must define them, see $xdoc.search-namespaces.

Example
$d[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
<t attr="
hello" n="123"/>}]
# result=hello
^d.selectString[string(t/@attr)]

Detailed specification of XPath is available at: http://www.w3.org/TR/xpath



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 01.04.2004