Win a copy of Design for the Mind this week in the Design 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.
    Bookmark Topic Watch Topic
  • New Topic