Type (XmlDoc/XmlNode function): Difference between revisions
Jump to navigation
Jump to search
m (→See also) |
m (match syntax table to syntax template, tags and edits) |
||
Line 1: | Line 1: | ||
{{Template:XmlDoc/XmlNode:Type subtitle}} | {{Template:XmlDoc/XmlNode:Type subtitle}} | ||
<var>type</var> returns the type of node of the head of the argument XPath result. | |||
==Syntax== | ==Syntax== | ||
{{Template:XmlDoc/XmlNode:Type syntax}} | {{Template:XmlDoc/XmlNode:Type syntax}} | ||
Line 7: | Line 7: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%xmlNodeType</th> | <tr><th>%xmlNodeType</th> | ||
<td>A declared enumeration object of type <var> | <td>A declared enumeration object of type <var>XmlNodeType</var> to contain the returned value of <var>Type</var>. These values are listed in "[[Type_(XmlDoc/XmlNode_function)#Usage_notes|Usage Notes]]", below.</td></tr> | ||
<tr><th>nr</th> | <tr><th>nr</th> | ||
<td>An <var>XmlDoc</var> or <var>XmlNode</var>, used as the context node for the <var class="term">xpath</var> expression. If an <var>XmlDoc</var>, the Root node is the context node. </td></tr> | <td>An <var>XmlDoc</var> or <var>XmlNode</var>, used as the context node for the <var class="term">xpath</var> expression. If an <var>XmlDoc</var>, the Root node is the context node. </td></tr> | ||
<tr><th>xpath</th> | <tr><th>xpath</th> | ||
<td>A <var>Unicode</var> string that is an | <td>A <var>Unicode</var> string that is an <var class="term">xpath</var> expression that results in a <var class="term">modelist</var>. The head of the <var class="term">modelist</var> is the <var class="term">mode</var> to process. | ||
<p>This is an optional argument whose default is a period (.), that is, the node referenced by the method object (<var class="term">nr</var>). Prior to <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.6, this argument is an EBCDIC string.</p></td></tr> | |||
This is an optional argument whose default is a period (.), that is, the node referenced by the method object (< | |||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul><li><var>Type</var> returns an <var>XmlNode</var><var>Type</var> enumeration value, which may be one | |||
of the following:<ul><li>Attribute | |||
of the following | |||
<ul> | |||
<li>Attribute | |||
<li>Comment | <li>Comment | ||
<li>Element | <li>Element | ||
Line 30: | Line 24: | ||
<li>Text | <li>Text | ||
</ul> | </ul> | ||
For more information about enumerations, see [[Enumerations]].</ul> | |||
===Example=== | ===Example=== | ||
<ol><li>The following example displays the string value of the type of the node pointed to by <code>%nod</code>: | |||
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></ol> | ||
===Request-Cancellation Errors=== | ===Request-Cancellation Errors=== | ||
Line 45: | Line 39: | ||
==See also== | ==See also== | ||
<ul> | <ul> | ||
<li>For more information about using XPath expressions, see [[XPath|"XPath"]]. | <li>For more information about using XPath expressions, see [[XPath|"XPath"]]. | ||
</ul> | </ul> | ||
{{Template:XmlDoc/XmlNode:Type footer}} |
Revision as of 05:01, 10 April 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
Example
- 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".