File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XSLT get parent node based on child node's attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "XSLT get parent node based on child node Watch "XSLT get parent node based on child node New topic
Author

XSLT get parent node based on child node's attribute

Vijay Rao
Greenhorn

Joined: Aug 19, 2006
Posts: 3
Hello all,

I have been struggling to learn XSL and stuck with one issue.

My input xml file is as follows:



What i need is as follows:

if a object has parentId, get the object whose id attribute matches with
current object's parentId.

If matches and the type of the found parent object is of type 'horizontal',
then get the color object.

below is the xsl i was trying to write.
Any help would be appreciatable.


[ April 11, 2007: Message edited by: Vijay Rao ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Try this, or something like it:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSLT get parent node based on child node's attribute
 
Similar Threads
to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not
XML to XML using XSLT
problem with Tomcat4.0.3+jstl for xml transformation
Extracting XSL content to XML with XSLT problem ...
Generating xsl to convert Xml into text format using transformation engine.