JAXP DOM Reference: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 14: Line 14:


=Node=
=Node=
==Node Types==


==Node's Text Content==
==Node's Text Content==


To get the text a node contains, you need to look through the list of child nodes, ignoring entries that are of no concern and accumulating the text you find in TEXT nodes, CDATA nodes, and EntityRef nodes.
To get the text a node contains, you need to look through the list of child nodes, ignoring entries that are of no concern and accumulating the text you find in TEXT nodes, CDATA nodes, and EntityRef nodes.

Revision as of 02:51, 11 November 2016

Internal

Overview

For an example of how to walk a DOM tree, see:

https://github.com/NovaOrdis/playground/tree/master/java/xml/dom-reading

Document

Node

Node Types

Node's Text Content

To get the text a node contains, you need to look through the list of child nodes, ignoring entries that are of no concern and accumulating the text you find in TEXT nodes, CDATA nodes, and EntityRef nodes.