GNOME Bugzilla – Bug 54446
Duplicate attributes in output
Last modified: 2009-08-15 18:40:50 UTC
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:attribute-set name="my-attr-set"> <xsl:attribute name="attr">from-attr-set</xsl:attribute> </xsl:attribute-set> <xsl:template match="/"> <p xsl:use-attribute-sets="my-attr-set" attr="from-p-tag"> <xsl:attribute name="attr">from-xsl-attr</xsl:attribute> </p> </xsl:template> </xsl:stylesheet> The template above generates the output: <?xml version="1.0"?> <p attr="from-xsl-attr" attr="from-p-tag"/> Notice the duplicate attribute "attr".
Okay I think it's fixed, as the spec says: 7.1.3 Creating Attributes with xsl:attribute "Adding an attribute to an element replaces any existing attribute of that element with the same expanded-name." So I assume the following behaviour is correct. Patch not provided since it spans both libxslt and libxml, it's commited in CVS though thanks for the report, Daniel orchis:~/XSLT/tests/general -> xsltproc bug-27-.xsl ../docs/bug-27-.xml <?xml version="1.0"?> <p attr="from-xsl-attr"/> orchis:~/XSLT/tests/general ->
Shipped in 0.10.0, considered closed, Daniel