This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
    Bookmark Topic Watch Topic
  • New Topic

create a TXElement and get a TXText

Barbara Foute Nelong
Posts: 20
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello everyone,
can anybody shed light on my problem?
I create an xml document with the ibm parser, I print the result to the console and I get:
wich is exactly the data structure I want. I save it to a file.
Now I want to get the file, parse it and loop through the nodes to get to a specific node.
NonValidatingTXDOMParser parser = new NonValidatingTXDOMParser();
parser.parse(new InputSource(xml));
doc = (;
now I want to find the element "type" in my datastructure and visit its children:
for(Node node=doc.getDocumentElement().getFirstChild();
I cannot get pass this point because the node.getNodeName always returns "#text".
A system.out.println(node) reveals that the parser see the element (that I have created as TXElement) as a TXtext...
Anybody knows why?
Any way around it?

[This message has been edited by Barbara Foute Nelong (edited July 08, 2001).]
Jim Yingst
Posts: 18671
  • Mark post as helpful
  • send pies
  • Report post to moderator
Asked and answered here.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!