wood burning stoves 2.0*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
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: 18541
    
    8

Try this, or something like it:
 
 
subject: XSLT get parent node based on child node's attribute