Returns the text content descendent of a node. The node can be passed as argument or as attribute.
1 dom.node.getChildCharacterData
<dom.node.getChildCharacterData name='name'>
<node /> !
</dom.node.getChildCharacterData>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | String |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Enode | Node |
Returns | |
---|---|
Type | Description |
String | The text content descendent of a node. |
Example
Get the text content of two nodes of a document.
Copy
<xsql-script name='dom_node_getChildCharacterData'> <body> <set name='root'> <dom.parse><file name='c:\tmp\data.xml' type='absolute' /></dom.parse> </set> <!-- It is situated in the text node which contains the text hello --> <set name='elem_text'> <dom.element.getFirstChildElement><root /></dom.element.getFirstChildElement> </set> <!-- Return null, because it is an element --> <println> <dom.node.getChildCharacterData> <root/> </dom.node.getChildCharacterData> </println> <!-- Return hello --> <println> <dom.node.getChildCharacterData> <elem_text/> </dom.node.getChildCharacterData> </println> </body> </xsql-script>