xsl-list
[Top] [All Lists]

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

2008-05-14 02:43:39
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(_at_)yahoo(_dot_)com] 
Sent: 14 May 2008 10:34
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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


      

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>