After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 54446 - Duplicate attributes in output
Duplicate attributes in output
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Solaris
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-05-10 14:28 UTC by jonasw
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jonasw 2001-05-10 14:28:55 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".
Comment 1 Daniel Veillard 2001-05-11 17:38:30 UTC
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 ->
Comment 2 Daniel Veillard 2001-05-23 14:21:35 UTC
Shipped in 0.10.0, considered closed,

Daniel