Re: [xsl] Merging arbitrary XML files

Subject: Re: [xsl] Merging arbitrary XML files
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Sun, 29 May 2005 17:50:20 -0700 (PDT)
Hi Frans,
  I wrote a merging XSLT stylesheet some time back.
The URL is http://gandhimukul.tripod.com/merge.html ..

I'll be happy if this may help you .. This stylesheet
assumes a particular structure for source XMLs ; so
may not meet your criteria exactly ..

Regards,
Mukul

--- Frans Englich <frans.englich@xxxxxxxxx> wrote:
 For example, for the following
> two files:
> 
> -----------
> <doc>
> 	<foo/>
> 	<bar/>
> </doc>
> -----------
> 
> -----------
> <doc>
> 	<foo href="content" />
> 	<bar/>
> 	<joe/>
> </doc>
> -----------
> 
> Would the result be:
> -----------
> <doc>
> 	<foo href="content" />
> 	<bar/>
> 	<bar/>
> 	<joe/>
> </doc>
> -----------
> 
> Some of the approaches wouldn't be obvious, but
> conventional. For example how 
> to do with identical attributes would perhaps be
> defined as depending on what 
> file that is merged into which one(or vice versa),
> and interpreting identical 
> elements as that they should be added next to each
> other(as opposed to one 
> replacing) is also arbitrary.
> 
> From my reading of the Delta-XML paper(skimmed), it
> looks like they solved it, 
> by producing a middle-step with a XML file
> containing meta-data by the use of 
> procedural-code(or whatever is term for those
> classic languages?), which then 
> is with XSL-T transformed to a suitable output.
> 
> However.. I want to do it with XSL-T 1.0(or 2.0, if
> necessary), and perhaps 
> some E-XSLT.
> 
> But I've not gotten very far. I think an Identity
> Transform is a good start. 
> From each template that matches an element or
> attribute, one could from there 
> look up the appropriate sections in the other file. 
> 
> AFAICT, one can find a lot of information about the
> context, but I don't know 
> how to bring that to use in order to locate the
> nodes that needs to be merged 
> from the other file.
> 
> I wonder:
> 
> Does anyone know of any open source project that
> attempts to do XML merging?
> 
> Anyone has a template or two of their shelf that
> does it? ;-)
> 
> 
> In other words, brain storming, thoughts about this,
> is appreciated.
> 
> 
> Cheers,
> 
> 		Frans
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Current Thread