Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 27th, 2009, 10:44 AM
Registered User
 
Join Date: May 2008
Location: , , USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing a node bases on child node value

Hey all,

I want to access for each coverage, for each vehicle a combined node of ABC and EFG, I wanna show. I know that I ll have to concat the values of CoverageLimit but How can I acccess two nodes at a time.

Thankx in advance.

Output:

Vehicle 1: ABC Upto 50,000/Upto 50,000
Vehicle 2: ABC Upto 50,000/Upto 50,000



<Policy>
<Vehicle id="v1">
<Coverage>
<CoverageName>ABC</CoverageName>
<CoverageLimit>Upto 50,000</CoverageLimit>
<CoverageAmount>100</CoverageAmount>
<Indicator>TL</Indicator>
</Coverage>
<Coverage>
<CoverageName>EFG</CoverageName>
<CoverageLimit>Upto 50,000</CoverageLimit>
<CoverageAmount>50</CoverageAmount>
<Indicator></Indicator>
</Coverage>
<Coverage>
<CoverageName>HIJ</CoverageName>
<CoverageLimit>Upto 10,000</CoverageLimit>
<CoverageAmount>20</CoverageAmount>
<Indicator></Indicator>
</Coverage>
<Coverage>
<CoverageName>KLM</CoverageName>
<CoverageLimit>Upto 100,000</CoverageLimit>
<CoverageAmount>10</CoverageAmount>
<Indicator>TL</Indicator>
</Coverage>
</Vehicle>
<Vehicle id="v2">
<Coverage>
<CoverageName>ABC</CoverageName>
<CoverageLimit>Upto 50,000</CoverageLimit>
<CoverageAmount>100</CoverageAmount>
<Indicator>TL</Indicator>
</Coverage>
<Coverage>
<CoverageName>EFG</CoverageName>
<CoverageLimit>Upto 50,000</CoverageLimit>
<CoverageAmount>50</CoverageAmount>
<Indicator></Indicator>
</Coverage>
<Coverage>
<CoverageName>HIJ</CoverageName>
<CoverageLimit>Upto 10,000</CoverageLimit>
<CoverageAmount>20</CoverageAmount>
<Indicator></Indicator>
</Coverage>
<Coverage>
<CoverageName>KLM</CoverageName>
<CoverageLimit>Upto 100,000</CoverageLimit>
<CoverageAmount>10</CoverageAmount>
<Indicator>TL</Indicator>
</Coverage></Vehicle>
<Vehicle id="v3">
<Coverage>
<CoverageName>ABC</CoverageName>
<CoverageLimit>Upto 50,000</CoverageLimit>
<CoverageAmount>100</CoverageAmount>
<Indicator>TL</Indicator>
</Coverage>
<Coverage>
<CoverageName>EFG</CoverageName>
<CoverageLimit>Upto 50,000</CoverageLimit>
<CoverageAmount>50</CoverageAmount>
<Indicator></Indicator>
</Coverage>
<Coverage>
<CoverageName>HIJ</CoverageName>
<CoverageLimit>Upto 10,000</CoverageLimit>
<CoverageAmount>20</CoverageAmount>
<Indicator></Indicator>
</Coverage>
<Coverage>
<CoverageName>KLM</CoverageName>
<CoverageLimit>Upto 100,000</CoverageLimit>
<CoverageAmount>10</CoverageAmount>
<Indicator>TL</Indicator>
</Coverage>
</Vehicle>
</Policy>
Reply With Quote
  #2 (permalink)  
Old February 27th, 2009, 11:26 AM
Friend of Wrox
Points: 6,663, Level: 34
Points: 6,663, Level: 34 Points: 6,663, Level: 34 Points: 6,663, Level: 34
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,239
Thanks: 0
Thanked 244 Times in 243 Posts
Default

Code:
<xsl:value-of select="concat(Coverage[CoverageName = 'ABC']/CoverageLimit, '/', Coverage[CoverageName = 'EFG']/CoverageLimit)"/>
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select correct child node richieWolf XSLT 4 September 24th, 2008 08:53 AM
The reference node is not a child of this node.XSL XMLUser XSLT 2 February 25th, 2008 04:22 AM
how to append child node after an node in XML + C# vishnu108mishra XML 5 November 13th, 2007 04:30 AM
How to count the child node suri_1811 XSLT 6 November 10th, 2006 03:51 PM
Child Node Output Neal XSLT 0 June 7th, 2006 03:14 AM



All times are GMT -4. The time now is 05:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.