Hello,
I am getting a ClassCastException with the code listed below.
The problem is with the line: "DocumentTraversal traversal=(DocumentTraversal) doc", where I get a java.lang.ClassCastException error.
A similar problem was brought up at
Previous JavaRanch Topic - what am I doing wrong?and answered by someone with considerable authourity - however, as far as
I can tell Document to DocumentTraversal casting is permitted:
XML APIs Quick Reference (under the DocumentTraversal section)
Also, most of this code (including the casting) is from the relatively authouritative ibm site:
Using a DOM NodeFilter Code follows below:
Edit Comment: Added [ code ] [ / code ] tags, without the space.
[ November 02, 2004: Message edited by: Madhav Lakkapragada ]