Length (XmlDoc/XmlNode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 24: Line 24:
end
end
</p>
</p>
==Request-Cancellation Errors==
==Request-cancellation errors==
<ul>
<ul>
<li>The <var class="term">xpath</var> expression is invalid.
<li>The <var class="term">xpath</var> expression is invalid.

Revision as of 15:29, 1 June 2011

Length of string-value of selected node (XmlDoc and XmlNode classes)

Length returns the length of the string-value of a node including its Text descendants.

Syntax

%number = nr:Length[( [xpath])] Throws XPathError

Syntax terms

%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. An optional argument, 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.

Examples

The following example displays the value 13:

begin %d object xmlDoc %d = new %d:loadXml('<t><a>Hell</a>' with - '<b>o, world!</b></t>') print %d:length('/t') end

Request-cancellation errors

  • The xpath expression is invalid.
  • Result of xpath is empty.
  • Insufficient free space exists in CCATEMP.

See also

  • Value discusses the string-value of various node types.
  • For more information about using XPath expressions, see "XPath".