|
Java™ by example!
|
|
|
How do I traverse an DOM tree using a TreeWalker?
(DOM Level 2!) TreeWalker allows you to navigate a DOM tree. You can specify the view on the tree with whatToShow flags and a NodeFilter (for an example on using a NodeFilter, check out How do I traverse a DOM tree using a NodeIterator). Once you have a TreeWalker instance, you can navigate through the structure using various methods that speak for themselves. Check out the API docs for more information: TreeWalker, NodeFilter. customers.xml (!!remove the space between ? and xml):
Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|