Late expansion of attribute value template in attribute name results in wrong precedence when merging attributes from different sets.
In this example a low-priority attribute set, "local", creates an attribute with AVT name, which resolves to a string "avtPASS", and the value "FAIL". Another attribute set "attrs", uses the first one, and itself declares an attribute with name "avtPASS" and the value "PASS".
Combined, this should be equivalent to avtPass="PASS". Running xsltproc (libxslt 10134), the result is "FAIL".
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="avtname" select="'PASS'"/>
<xsl:output indent="yes"/>
<xsl:template match="/">
<xsl:element name="result" use-attribute-sets="attrs"/>
</xsl:template>
<xsl:attribute-set name="attrs" use-attribute-sets="local">
<xsl:attribute name="simple">PASS</xsl:attribute>
<xsl:attribute name="avtPASS">PASS</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="local">
<xsl:attribute name="local-only">PASS</xsl:attribute>
<xsl:attribute name="simple">FAIL</xsl:attribute>
<xsl:attribute name="avt{$avtname}">FAIL</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>
Observed: <result simple="PASS" avtPASS="FAIL" local-only="PASS"/>
Expected: <result simple="PASS" avtPASS="PASS" local-only="PASS"/>
Regards, Mike