View Single Post
  #2 (permalink)  
Old May 5th, 2010, 09:30 AM
Martin Honnen Martin Honnen is offline
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts

With XSLT 2.0 and 1.0 you can use the document function to pull in XML documents.
With XSLT 2.0 you can also use the doc function.
Here is an XSLT 2.0 stylesheet that uses the document function but makes use of the third parameter of the key function that is only available in XSLT 2.0:
  <xsl:output method="xml" indent="yes"/>
  <xsl:param name="f2" select="'test2010050503.xml'"/>
  <xsl:param name="f3" select="'test2010050504.xml'"/>
  <xsl:variable name="doc2" select="document($f2)"/>
  <xsl:variable name="doc3" select="document($f3)"/>
  <xsl:key name="k1" match="Response/Result/info" use="id"/>
  <xsl:template match="Response/Result/List">
      <xsl:apply-templates select="key('k1', typeid, $doc2)/rfs, key('k1', typeid, $doc3)/code"/>
      <xsl:apply-templates select="agentname, Addess1"/>
  <xsl:template match="Response/Result/info/* | Response/Result/List/*">
    <xsl:element name="{local-name()}">

Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote