Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| 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 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 September 11th, 2006, 07:28 AM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL problem

I have this XML design:

<root>
   <aaa>
      <bbb>
         <ccc>ABC</ccc>
         <ddd>out1</ddd>
      </bbb>
      <bbb>
         <ccc>DEF</ccc>
         <ddd>out2</ddd>
      </bbb>
   </aaa>
   <aaa>
      <bbb>
         <ccc>ABC</ccc>
         <ddd>out3</ddd>
      </bbb>
   </aaa>
</root>


and I need to generate this xml output:

<root>
   <aaa>
      <ddd>out1</ddd>
      <ddd>out3</ddd>
   </aaa>
   <aaa>
      <ddd>out2</ddd>
   </aaa>
</root>


i'm having a hard time figuring out how to get the value of "ddd" and put them under a common element "aaa" if their value of "ccc" are the same.


 
Old September 14th, 2006, 01:20 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ramesh.kumarm
Default

Well
you can possibly do something like this to retrieve the first and the second values for the same name tags, respectively.

//root/aaa[1]/ccc[1] ->for the first.

Hope this helps!

ramesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL for-each/when problem Grofit XSLT 11 March 27th, 2008 10:26 AM
xsl:if problem lscjtw XSLT 2 July 26th, 2007 11:29 AM
Problem with XSL sandeepa XSLT 5 May 13th, 2005 04:31 AM
Help with xsl:when problem sundar_revathi XSLT 2 November 9th, 2004 07:39 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





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