xsl:attribute select attribute should raise an error
In XSLT 1.0 as supported by libxslt and xsltproc the xsl:attribute
element does not allow a select
attribute. However, xsltproc (tested with xsltproc was compiled against libxml 20910, libxslt 10134 and libexslt 820
) for the following code
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/*">
<xsl:copy>
<xsl:attribute name="test" select="'test value'"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
run against any XML input does not raise an error about the use of select
on xsl:attribute
but creates an XML result with a test
attribute.
As https://www.w3.org/TR/xslt-10/#section-Introduction mandates: "It is an error for an element from the XSLT namespace to have attributes with expanded-names that have null namespace URIs (i.e. attributes with unprefixed names) other than attributes defined for the element in this document." the failure to raise an error is a bug.