View Single Post
 
Old April 13th, 2008, 10:05 AM
RoeZ RoeZ is offline
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, i have this xml file which has the following node inside:

Code:
<intro>bla bla bla <link><url>gmail</url><text>Gmail</text></link> bla bla bla</intro>
i read in this file with the following xsl:

Code:
<xsl:variable name="xml.email" select="document('Translations/Email.xml')"/>
<xsl:variable name="lang.email" select="$xml.email/translations/info[lang($language)]" />
i call this 'text' with the following xsl:

Code:
<xsl:apply-templates select="$lang.email/intro" />
then i have this template which gets aplied:

Code:
<xsl:template match="link">
    <a>
        <xsl:attribute name="href">
            /email/<xsl:value-of select="url"/>/<xsl:value-of select="/source/pictureId"/>/<xsl:value-of select="/source/titleId"/>
        </xsl:attribute>
        <xsl:value-of select="text"/>
    </a>
</xsl:template>
the template does get called, but the 2 values inside (/source/pictureId and /source/titleId) aren't inserted, they are in the input xml though, i know this because when i do this, i get the right value from /source/pictureId:

Code:
<xsl:value-of select="/source/pictureId"/>
<xsl:apply-templates select="$lang.email/intro" />
so when i do the above, i see the value of /source/pictureId in front of my bla bla text.

Sorry for not posting the code, i didn't thought i had a bug but a silly beginner mistake