Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2009, 07:09 AM
Authorized User
 
Join Date: Apr 2008
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
Default how to call two xml document in same XSLT ??

Hi All,

Is it possible to call two different XML document in a single XSLT.

For example, i have to xml document x1 and x2 and from x1 i will read data and assgin to variable and then based on those variable value i want to retrieve data from X2 using XSLT.

how can i achieve that ?

Thanks in advance

Nelly
 
Old November 9th, 2009, 07:22 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Use the document function http://www.w3.org/TR/xslt#document that XSLT provides:
Code:
<xsl:template match="foo">
  <xsl:apply-templates select="document(@bar)/*"/>
</xsl:template>
That assumes that the 'bar' attribute of 'foo' elements contains a URL of the XML document to load.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
The Following User Says Thank You to Martin Honnen For This Useful Post:
nelly78 (November 9th, 2009)
 
Old November 9th, 2009, 08:14 AM
Authorized User
 
Join Date: Apr 2008
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Thanks Martin... Its working.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call javascript in XSLT oneilaus XSLT 0 June 19th, 2009 02:07 AM
xslt document function.. maddukuri XSLT 8 May 16th, 2008 06:31 AM
xslt 2.0 document function jkmyoung XSLT 2 November 18th, 2004 03:21 PM
Applying an XSLT to an XML document (II) Thodoris XML 1 April 28th, 2004 09:10 AM
Applying an XSLT to an XML document dimondwoof XML 1 June 26th, 2003 01:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.