On 17.09.2007 09:02, Sébastien Geindre wrote:

Another question about xsl 1.0 :

why when i apply such template
<xsl:template match="foo">
     <foobis>
       <xsl:attribute name="idbis" select="@id"/>
   </foobis>
</xsl:template>

on following xml :

<foo id="long_id"/>

i obtain :
with xalan <foobis idbis=""/>
with saxon <foobis idbis="long_id"/>

The above template is invalid for XSLT 1.0, xsl:attribute has no select attribute [1]. It has to be

<xsl:attribute name="idbis">
  <xsl:value-of select="@id"/>
</xsl:attribute>

The funny thing is it worked in older versions of Xalan as well and I used to use it. With one version (might have been 2.5) it suddenly stopped working, so Xalan was changed to be standard-compliant. As you said this has been added back to XSLT 2.0 though [2].

Joerg

[1] http://www.w3.org/TR/xslt#creating-attributes
[1] http://www.w3.org/TR/xslt20/#creating-attributes

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to