GNOME Bugzilla – Bug 59757
overriding attribute-sets doesn't work
Last modified: 2009-08-15 18:40:50 UTC
I previously mailed to the mailinglist about this, but got no answer. I still think it's a bug, so I'm submitting it: take foo.xml: <foo/> and foo1.xsl: <?xml version="1.0"?> <xsl:stylesheet version="1.0"x mlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:attribute-set name="foo-attribs"> <xsl:attribute name="size">+1</xsl:attribute> </xsl:attribute-set> <xsl:template match="foo"> <font xsl:use-attribute-sets="foo-attribs"> foo </font> </xsl:template> </xsl:stylesheet> and foo2.xsl, overriding the size attribute: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="foo1.xsl"/> <xsl:attribute-set name="foo-attribs"> <xsl:attribute name="size">+2</xsl:attribute> </xsl:attribute-set> </xsl:stylesheet> okay, xsltproc on foo1.xsl gives: $ xsltproc foo1.xsl foo.xml <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <font size="+1"> foo </font> good. but, xsltproc on foo2.xsl gives: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <font size="+1"> foo </font> not good, I'd expect +2 because I've overridden the attribute set. xt and Xalan do give +2 as expected. this is with libxslt 1.0.2
Okay, I fixed this in CVS: http://cvs.gnome.org/bonsai/cvsquery.cgi?module=libxslt&branch=HEAD&branchtype=match&dir=libxslt&file=&filetype=match&who=veillard&whotype=match&sortby=Date&hours=&date=explicit&mindate=09%2F10%2F01+13%3A42&maxdate=09%2F10%2F01+13%3A44&cvsroot=%2Fcvs%2Fgnome orchis:~/XSLT/tests/tmp -> xsltproc foo1.xsl foo.xml <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <font size="+1"> foo </font> orchis:~/XSLT/tests/tmp -> xsltproc foo2.xsl foo.xml <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <font size="+2"> foo </font> orchis:~/XSLT/tests/tmp -> thanks for the report ! Daniel
*** Bug 59991 has been marked as a duplicate of this bug. ***
this should be fixed in release 1.0.4, thanks, Daniel