This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Removing nodes based on a element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Removing nodes based on a element" Watch "Removing nodes based on a element" New topic
Author

Removing nodes based on a element

Raj Murthy
Greenhorn

Joined: Oct 25, 2005
Posts: 14
Need to remove duplicates in a xml file based on a element's value.
Just use the first node with the element in the resulting list;

Here is a sample xml:



The result needs to be:

Title1 Tom
Title3 Jim

In this case use the first occurance of the 'Author' element.
How can i accomplish this in xslt?
Any hints on which xsl functions i can use for this?

Thanks in Advance,
Rajiv
[ December 28, 2005: Message edited by: Rajiv Rangarajan ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Consider the answer to the identical question posted on the Sun forum.
Raj Murthy
Greenhorn

Joined: Oct 25, 2005
Posts: 14
Paul,
Yes, I did find the solution for the xml I posted
I have listed the same below for anyone interested.



Cheers,
Rajiv
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing nodes based on a element
 
Similar Threads
Passing Set<java.lang.Object> and List<java.lang.Object> in Axis 2.0
Castor: How to map list items within a "parent" list element?
Testing web application for jump from Tomact to Jboss on load
XML One liners for the exam....
How to implement getElementById() with Xerces using XML Schema?