[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT for mergig XML fragments into the base XML

Subject: XSLT for mergig XML fragments into the base XML
From: Zeev Atlas <zatlas1@xxxxxxxxx>
Date: Sun, 04 Sep 2011 22:17:36 -0400
 XSLT for mergig XML fragments into the base XML
I have a main XML file like this:

<myxmlroot>
<myxmlproject>
<myxmlincludetype1 filename="SOMEFILE1"/>
<myxmlincludetype2 filename="SOMEFILE2" attributes.../>
<myxmlbranchhead branchname="STEP1" attributes...>
<myxmlleafnode leafnodename="LFNM1" attributes.../>
etc.
<myxmlbranchhead/>
<myxmlproject/>
<myxmlroot/>



The fragments look like (SOMEFILE1)



<myxmlroot>
<myxmlincludetype2 filename="SOMEFILE3" attributes.../>
<myxmlbranchhead branchname="STEP3" attributes...>
<myxmlleafnode leafnodename="LFNM3" attributes.../>
etc.
<myxmlbranchhead/>
<myxmlroot/>


Only myxmlincludetype2 is available in the fragment. Both myxmlincludetype1 and myxmlincludetype2 are optional. When present they mean that the filename, which contain the fragment should be read, stripped from the myxmlroot tags and embeded in the output XML. The process is recursive. So the output should look like this:




<myxmlroot>
<myxmlproject>
<myxmlincludetype1 filename="SOMEFILE1"/>
here would be the fragment from SOMEFILE1
<myxmlincludetype2 filename="SOMEFILE3" attributes.../>
here would be the fragment from SOMEFILE3
<myxmlbranchhead branchname="STEP3" attributes...>
<myxmlleafnode leafnodename="LFNM3" attributes.../>
etc.
<myxmlbranchhead/>

<myxmlincludetype2 filename="SOMEFILE2" attributes.../>
here would be the fragment from SOMEFIL2
<myxmlbranchhead branchname="STEP1" attributes...>
<myxmlleafnode leafnodename="LFNM1" attributes.../>
etc.
<myxmlbranchhead/>
<myxmlproject/>
<myxmlroot/>



Could anybody please guide me where to look or even give me a sample XSLT file that handle similar case, it is the first time I deal with XML and XSLT

Thanks

ZA

Ze'ev Atlas
201-801-0378
201-805-0286 (cell)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.