aspose file tools*
The moose likes XML and Related Technologies and the fly likes XMLDOM - selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XMLDOM - selection" Watch "XMLDOM - selection" New topic
Author

XMLDOM - selection

Trina Thach
Greenhorn

Joined: Jun 12, 2001
Posts: 18
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

Joined: Dec 14, 2004
Posts: 68
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


Mahesh Trikannad
Trina Thach
Greenhorn

Joined: Jun 12, 2001
Posts: 18
Any sample codes (or URL related to this topic) would be thankful.
Mahesh Trikannad
Ranch Hand

Joined: Dec 14, 2004
Posts: 68
http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom_p.html

for JDOM.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XMLDOM - selection