1 dom.node.getNodeType
A code representing the type of underlying object:
- ELEMENT_NODE
- TEXT_NODE
The node can be passed as argument or as attribute.
<dom.node.getNodeType name='name'>
<node /> !
</dom.node.getNodeType>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | String |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Enode | Node |
Returns | |
---|---|
Type | Description |
Integer | Return the type of the nude. |
Example
Get the type of two nodes of a file.
Copy
<xsql-script name='dom_node_getNodeType'> <body> <set name='root'> <dom.parse><file name='data.xml' type='absolute' /></dom.parse> </set> <!-- It is situated in the first text node (the Line break) --> <set name='elem_text'> <dom.node.getFirstChild><root /></dom.node.getFirstChild> </set> <!-- Return a 1: ELEMENT_NODE (it is the root node, an element) --> <println> <dom.node.getNodeType> <root/> </dom.node.getNodeType> </println> <!-- Return a 3: TEXT_NODE (it is the text node line break, a text) --> <println> <dom.node.getNodeType> <elem_text/> </dom.node.getNodeType> </println> </body> </xsql-script>