p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > XML > XSLT
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 21st, 2004, 09:48 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: florida city, florida, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default merge two xml file and make new xml using xslt

hi,
 i have to use xslt for merge two xml file and make a new one.
here my two files...
*******m1.xml*******
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="merge.xsl"?>
<row-data1>
<rec>
      <date1>080104</date1>
      <description>CT-</description>
      <minutes>10</minutes>
</rec>
<rec>
      <date1>080304</date1>
      <description>Telephone</description>
      <minutes>30</minutes>
</rec>
<rec>
      <date1>080504</date1>
      <description>CT-</description>
      <minutes>50</minutes>
</rec>
<rec>
      <date1>080704</date1>
      <description>Telephone</description>
      <minutes>70</minutes>
</rec>
</row-data1>
*****************m2.xml*********
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="merge.xsl"?>
<row-data2>
<rec>
      <date1>080204</date1>
      <description>DDDDD</description>
      <minutes>20</minutes>
</rec>
<rec>
      <date1>080404</date1>
      <description>EEEEE</description>
      <minutes>40</minutes>
</rec>
<rec>
      <date1>080604</date1>
      <description>FFFFF</description>
      <minutes>60</minutes>
</rec>
</row-data2>
************merge.xsl*********
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"><xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<root>
<xsl:for-each select="document('m1.xml')/rec-data1/rec|
document('m2.xml')/rec-data2/rec[not(@date1=document('m1.xml')/rec-data1/rec/@date1)]">
<xsl:sort select="@date1"/><rec date1="{@date1}">
</rec>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
***************************
you give me the full updated sourcecode ...
I am newbie in xml/xsl....pl. give me the full sourcecode/change in all three files....and also let me know how i can make a new merge xml document.....

thanks

ketan
__________________
ketan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifiying XML File using XSLT brianlan XSLT 1 October 2nd, 2007 04:14 PM
importing XML file in to xslt ashyabhi_hp XSLT 2 September 23rd, 2007 12:15 AM
XSLT transformation from XML buffer and XSL file sundaramkumar Javascript 1 September 5th, 2005 03:11 AM
translate xml using xslt in a batch file? hhali XSLT 3 May 8th, 2005 01:48 PM
Merge XML files into a xml file using xslt lxu XML 4 November 6th, 2003 06:01 PM



All times are GMT -4. The time now is 03:00 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc