You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2008/02/07 14:26:08 UTC

Re: XSLT Transformation error in C2.2

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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org