1 dom.node.getNodeType

A code representing the type of underlying object:

  1. ELEMENT_NODE
  2. TEXT_NODE

The node can be passed as argument or as attribute.

<dom.node.getNodeType name='name'>
    <node /> !
</dom.node.getNodeType>
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>