xsl-list
[Top] [All Lists]

Re: [xsl] XSLT for mergig XML fragments into the base XML

2011-09-23 00:35:31
is your problem solved?

On 4 September 2011 19:17, Zeev Atlas <zatlas1(_at_)yahoo(_dot_)com> wrote:
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)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Vasu Chakkera
NodeLogic Limited
Oxford
www.node-logic.com
==============

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>