The parent of this node. All the nodes, except Attr, Document, DocumentFragment, Entity and Notation can have a parent.
However, if a node has just been created and has not yet been added to a tree, or if the tree has been deleted, results null.
The node can be passed as argument or as attribute.
1 dom.node.getParentNode
<dom.node.getParentNode name='name'>
<node /> !
</dom.node.getParentNode>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | String |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Enode | Node |
Returns | |
---|---|
Type | Description |
Document | Returns the node parent of the node. |
Example
Get the node parent of the node.
Copy
<xsql-script name='dom_node_getParentNode'> <body> <set name='root'> <dom.parse><file name='data.xml' type='absolute' /></dom.parse> </set> <!-- Return: <document> <element>hello</element> <element>world</element> </document> --> <println> <dom.node.getParentNode> <dom.element.getFirstChildElement><root/></dom.element.getFirstChildElement> </dom.node.getParentNode> </println> </body> </xsql-script>