Type (XmlDoc/XmlNode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Type of selected node</b></span>
{{Template:XmlDoc/XmlNode:Type subtitle}}
[[Category:XmlDoc methods|Type function]]
[[Category:XmlDoc methods|Type function]]
[[Category:XmlNode methods|Type function]]
[[Category:XmlNode methods|Type function]]
Line 12: Line 12:


This function gets the type of node of the head of the argument XPath result.
This function gets the type of node of the head of the argument XPath result.
===Syntax===
==Syntax==
  %nodTypEnum = nr:Type([Xpath])
{{Template:XmlDoc/XmlNode:Type syntax}}
 
===Syntax terms===
====Syntax Terms====
<dl>
<dl>
<dt>%nodTypEnum
<dt>%nodTypEnum
<dd>A declared enumeration object of type XmlNodeType to contain the returned
<dd>A declared enumeration object of type XmlNodeType to contain the returned
value of Type.
value of Type.
These values are listed in &ldquo;Usage Notes,&rdquo; below.
These values are listed in "Usage Notes," below.
<dt>nr
<dt>nr
<dd>An XmlDoc or XmlNode, used as the context node for the
<dd>An XmlDoc or XmlNode, used as the context node for the
Line 35: Line 34:
</dl>
</dl>


===Usage Notes===
==Usage notes==


The Type function returns an XmlNodeType enumeration value, which may be one
The Type function returns an XmlNodeType enumeration value, which may be one

Revision as of 16:57, 22 January 2011

Type of selected node (XmlDoc and XmlNode classes)

Type is a member of the XmlDoc and XmlNode classes.

This function gets the type of node of the head of the argument XPath result.

Syntax

%xmlNodeType = nr:Type[( [xpath])] Throws XPathError

Syntax terms

%nodTypEnum
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 nodelist. The head of the nodelist is the node 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

The Type function returns an XmlNodeType enumeration value, which may be one of the following. For more information about enumerations, see Enumerations.

  • 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.