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 March 23rd, 2011, 06:22 AM
Registered User
 
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mirge Multiple nodes with sons elements

Hi ,

I am newbie in XSL ,but i need XSL file that merge nodes with the same name attribute into one element-and the same done for the son nodes-, and if there is nodes' with different names it put as it , a example of XML is as follows .

<?xml version="1.0" encoding="UTF-8"?>
<test>
<component name="root">
<component name="c2">
<component name="c3">
<component name="c4"/>
</component>
</component>
</component>
<component name="root">
<component name="c2">
<component name="A4">
</component>
</component>
</component>
<component name="root">
<component name="A3"/>
</component>
<component name="root">
<component name="X1">
<component name="X2"></component>
</component>
</component>
<component name="difRoot">
</component>
</test>

The desired output is as follows
<output>
<component name="root">
<component name="c2">
<component name="c3">
<component name="c4"/>
</component>
<component name="A4">
</component>
</component>
<component name="A3"/>
<component name="X1">
<component name="X2"/>
</component>
</component>
<component name="difRoot">
</component>
</output>

Thanks
 
Old March 24th, 2011, 07:40 AM
Registered User
 
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi for the solution please follow that link

http://stackoverflow.com/questions/5...h-nested-nodes

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert multiple elements based on values of others fixit XSLT 14 September 25th, 2009 05:36 AM
Help deleting multiple XML nodes sigilaea Visual Basic 2005 Basics 1 October 1st, 2007 04:45 PM
Appending set of elements after the similar nodes sesath XSLT 2 May 15th, 2007 10:16 AM
*solved* applying same template to multiple nodes Brian Campbell XSLT 3 October 13th, 2006 06:56 PM
Grouping orphan nodes to paranet elements ROCXY XSLT 2 January 1st, 2006 07:11 AM





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