Type (XmlDoc/XmlNode function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Examples) |
||
Line 27: | Line 27: | ||
==Examples== | ==Examples== | ||
The following example displays the string value of the type of the node pointed to by <code>%nod</code>: | |||
<p class="code">print %nod:type:toString | <p class="code">print %nod:type:toString | ||
</p | </p> | ||
==Request-Cancellation Errors== | ==Request-Cancellation Errors== |
Revision as of 22:39, 16 May 2011
Type of selected node (XmlDoc and XmlNode classes)
type returns the type of node of the head of the argument XPath result.
Syntax
%xmlNodeType = nr:Type[( [xpath])] Throws XPathError
Syntax terms
%xmlNodeType | A declared enumeration object of type XmlNodeType to contain the returned value of Type. These values are listed in "Usage Notes", below. |
---|---|
nr | An XmlDoc or XmlNode, used as the context node for the xpath expression. If an XmlDoc, the Root node is the context node. |
xpath | A Unicode string that is an xpath expression that results in a modelist. The head of the modelist is the mode to process.
This is an optional argument whose default is a period (.), that is, the node referenced by the method object (nr). Prior to "Sirius Mods" Version 7.6, this argument is an EBCDIC string. |
Usage notes
- Type returns an XmlNodeType enumeration value, which may be one of the following:
- Attribute
- Comment
- Element
- PI (which stands for Processing Instruction)
- Root
- Text
Examples
The following example displays the string value of the type of the node pointed to by %nod
:
print %nod:type:toString
Request-Cancellation Errors
- XPath is invalid.
- Result of (XPath) is empty.
- Insufficient free space exists in CCATEMP.
See also
- For more information about using XPath expressions, see "XPath".