This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xsl:eval : how to pass a <xsl:value-of> ?


Hi everybody,

I'm a newbie in XSL and I'm trying with no luck to do the following (or the
equivalent) with IE5 :

<xsl:template match="Graphic">
     <IMG>
     <xsl:attribute name="src"><xsl:value-of select="@FileRef"/></xsl:attribute>
     <xsl:attribute name="alt"><xsl:eval><xsl:value-of select="@FileRef"/></xsl:eval></xsl:attribute>
     </IMG>
</xsl:template>

The error comes from the fact that I can't put an <xsl:value-of> inside a <xsl:eval>. So how could I do that ?

Since <xsl:variable> is not accessible with IE5, I tried the script, somthing like this :
<xsl:script><![CDATA[
     function GiveAlternate(img){
             return img.src;
          }
]]></xsl:script>


<xsl:template match="Graphic">
     <IMG>
     <xsl:attribute name="src"><xsl:value-of select="@FileRef"/></xsl:attribute>
     <xsl:attribute name="alt"><xsl:eval>GiveAlternate(this)</xsl:eval></xsl:attribute>
     </IMG>
</xsl:template>

But then, it gives me an empty string.

So, I'm stuck here and I would appreciate any help/suggestions.

Thanks,
Stéphane Pantin


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]