RE: Work with two xmls and combine them using xsl
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: 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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format