File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XMLDOM - selection

 
Trina Thach
Greenhorn
Posts: 18
  • 0
  • 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: 68
  • 0
  • 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
  • 0
  • 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: 68
  • 0
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic