Length (XmlDoc/XmlNode function)
Length returns the length of the string-value of a node including its Text descendants.
%number = nr:Length[( [xpath])] Throws XPathError
|%number||A numeric variable to contain the returned value from Length.|
|nr||An XmlDoc or XmlNode, used as the context node for the xpath argument expression. If an XmlDoc, the Root node is the context node.|
|xpath||A Unicode string that is an XPath expression that results in a nodelist. The head of the nodelist is the node to process. Any other nodes in the nodelist are ignored.
This is an optional argument, and its default is a period (.), that is, the node referenced by the method object (nr). Prior to Sirius Mods Version 7.6, this is an EBCDIC string.
The following example displays the value
begin %d object xmlDoc %d = new %d:loadXml('<t><a>Hell</a>' with - '<b>o, world!</b></t>') print %d:length('/t') end
This list is not exhaustive: it does not include all the errors that are request cancelling.
- The xpath expression is invalid.
- Result of xpath is empty.
- Insufficient free space exists in CCATEMP.
- Value discusses the string-value of various node types.
- For more information about using XPath expressions, see XPath.