[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Work with two xmls and combine them using xsl


Subject: RE: [xsl] Work with two xmls and combine them using xsl
From: sudheshna iyer <sudheshnaiyer@xxxxxxxxx>
Date: Wed, 14 May 2008 02:45:02 -0700 (PDT)

Thank you Mike.
--- Michael Kay <mike@xxxxxxxxxxxx> wrote:

> Your example documents aren't well-formed (no outer
> element) so you'll have
> to adapt this code. But try something like this:
> 
> <xsl:template match="/">
> <result>
>   <xsl:apply-templates select="* |
> document('Second.xml')/*"/>
> </result>
> </xsl:template> 
> 
> so when you process the document node of first.xml,
> it causes the outermost
> elements of both first.xml and second.xml to be
> processed.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> > -----Original Message-----
> > From: sudheshna iyer
> [mailto:sudheshnaiyer@xxxxxxxxx] 
> > Sent: 14 May 2008 10:34
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: [xsl] Work with two xmls and combine them
> using xsl
> > 
> > I have the feed from two different sources.I need
> to combine 
> > both of them and produce a common list.
> > 
> > 
> > How do I read from two xml files in xsl and
> produce the list 
> > of events?
> > For eg: 
> > 
> > First.xml
> > 
> > <?xml version=1.1>
> > <eventname>first-eve</eventname>
> > <eventtitle>first-title<eventtitle>
> > ..
> > 
> > Second.xml
> > <?xml version=1.1>
> > <eventname>second-eve</eventname>
> > <eventtitle>second-title<eventtitle>
> > ..
> > 
> > Now after applying xsl transformation of both of
> the above 
> > xmls, I should get:
> > 
> > EventName: 	first-eve
> > Event Title:	first-title
> > 
> > EventName: 	second-eve
> > Event Title:	second-title


Current Thread
Keywords