View Single Post
 
Old April 13th, 2008, 10:11 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
Default

So you have two XML input documents, the primary contaning a 'source' element, and a secondary you pull in with the document function. Use a global variable to store the root of the primary input document e.g.
Code:
<xsl:variable name="main-root" select="/"/>
then use that variable in your template:
Code:
<xsl:template match="link">
    <a>
        <xsl:attribute name="href">
            /email/<xsl:value-of select="url"/>/<xsl:value-of select="$main-root/source/pictureId"/>/<xsl:value-of select="$main-root/source/titleId"/>
        </xsl:attribute>
        <xsl:value-of select="text"/>
    </a>
</xsl:template>
--
  Martin Honnen
  Microsoft MVP - XML