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

Then you need to use a prefix for the namespace and write some more code:
Code:
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:t="http://test.com"
  exclude-result-prefixes="t"
  version="1.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="t:Response/t:Result/t:info" use="t:id"/>
  
  <xsl:template match="t:Response/t:Result/t:List">
    <Row>
      <xsl:variable name="tid" select="t:typeid"/>
      <xsl:for-each select="$doc2">
        <xsl:apply-templates select="key('k1', $tid)/t:rfs"/>
      </xsl:for-each>
      <xsl:for-each select="$doc3">
        <xsl:apply-templates select="key('k1', $tid)/t:code"/>
      </xsl:for-each>
      <xsl:apply-templates select="t:agentname | t:Addess1"/>
    </Row>
  </xsl:template>
  
  <xsl:template match="t:Response/t:Result/t:info/* | t:Response/t:Result/t:List/*">
    <xsl:element name="{local-name()}">
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote