Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2014, 02:39 PM
Registered User
 
Join Date: Feb 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Get Parent Node value from child condition

Not sure I described this correctly in the Title, but anyway here is my sample XML:

<Unit>
<UnitQualifierGid>
<ID>
<DomainName>XXXX</DomainName>
<Xid>LOAD DATE</Xid>
</ID>
</UnitQualifierGid>
<UnitValue>2/24/14</UnitValue>
</Unit>
<Unit>
<UnitQualifierGid>
<ID>
<DomainName>XXXX</DomainName>
<Xid>REFERENCE NUMBER</Xid>
</ID>
</UnitQualifierGid>
<UnitValue>98499</UnitValue>
</Unit>

What I need to get is the Unit/UnitValue value where the Unit/UnitQualifierID/ID/XID = LOAD DATE
I can't seem to figure how to get down into to see if its a Load Date, then back out to get the unitvalue.

thanks
 
Old February 26th, 2014, 02:45 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Use //Unit[UnitQualifierGid/ID/Xid = 'LOAD DATE']/UnitValue
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the following node children based on the node condition JohnKiller XSLT 6 April 20th, 2012 01:10 PM
XSLT logic for repeating child elements within parent node Srinibondugula BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 5 November 8th, 2011 12:05 PM
Displaying data as a Parent Node with Left Node and Right Node Manoj Bisht Visual Basic 2008 Professionals 0 April 2nd, 2009 02:34 AM
Problem with displaying parent /child node in C# vishnu108mishra XML 1 November 16th, 2007 05:37 PM
Select parent node when any one child has key pparadesia XSLT 2 January 7th, 2005 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.