Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XMLDOM - selection

 
Trina Thach
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following XML:
<root>
<tag>text 1</tag>
<tag>text 2.</tag>
<tag1>text 3</tag1>
<nextag>text text text text text text</nextag>
<tag>text text</tag>
<tag2>text text</tag2>
</root>

I want to write a script (Perl, ASP, JAVA anything will do) using XMLDOM to select all tags before <nextag>. Please help!

Thanks muchly.
 
Mahesh Trikannad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U could use a DOM Parser ( JAXP or JDOM ), iterate through the tags till u find the one u want to stop at. JAXP and JDOM are JAVA APIS
 
Trina Thach
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any sample codes (or URL related to this topic) would be thankful.
 
Mahesh Trikannad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom_p.html

for JDOM.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic