Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple question for XML Gurus

 
raphael Bereh
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to parse an xml schema for ELEMENT_NODE and build a Tree from these .
How do I proceed ?
Thanks
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is like you want to use an English grammar to build an English novel on it. It is NOT exactly accurate analogy, but you've got my idea anyway.
You probably can make an example from it, and that is probably not very hard, but why to waste time on it, IMHO.
You are welcome to try, and prove I'm totally wrong. I would be more than happy to accept it.
 
raphael Bereh
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be I did not explain well.
I am building a JTree from the DOM and the objective is to strip out all Text elemments that the parser see as being the xml file elements.
Example :
<xml ..>
<test>
<my_real_element_one>
There is no element betwee this one and the root
</my_real_element_one>
</test>
</xml>
Hope this makes it clear !
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry! The question does not make a lot of sense to me. It looks like a HW assignment.
JTree does not grow naturally like most trees in the rain forest. JTree is built by your own code, you can put or choose not to put anything on it.
[ November 12, 2002: Message edited by: Roseanne Zhang ]
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raphael,
Please look at the following link -
http://www.coderanch.com/t/146641/po/certification/over-DOM
It gives an example as to how to use the DOM API in Java. Please go through the content of the program in the above link and you should get a very fair idea as to how to proceed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic