GNOME Bugzilla – Bug 704071
use-attribute-sets, inside attribute-set tag, not given the right import precedence
Last modified: 2016-06-21 12:23:59 UTC
Created attachment 248991 [details] Testcase I have the issue that I want to override a few attributes defined in the original DocBook stylesheets with my customisation. However, how I want to define the attribute is dependant on another factor, so I chose to use another xsl:attribute-set (in the testcase "sans.bold"), and then import its attributes into the one that is defined both in DocBook and in my customisation (in the testcase, "admonition.title.properties"). The problem is, that xsltproc seems to use the following import precendence rules: #1 attributes defined directly in my customisation (as you can see in the testcase, it does font-size="30pt") #2 attributes defined by the original DocBook stylesheets (it uses font-weight="bold") #3 attributes defined in the "use-attribute-setted" attribute-set (it does import the line-height="1.2em") To reproduce, * install the DocBook stylesheets (I'm using 1.78.0) * untar the attached Testcase in some folder * run $ xsltproc testcase.xsl testcase.xml * check the block around the text "The font-weight value[…]" in the output
Also, I am using: Using libxml 20900, libxslt 10128 and libexslt 817 xsltproc was compiled against libxml 20900, libxslt 10128 and libexslt 817 libxslt 10128 was compiled against libxml 20900 libexslt 817 was compiled against libxml 20900 Packages: * libxml2-tools-2.9.0-2.9.1.x86_64 * libxslt-tools-1.1.28-3.4.1.x86_64 Also: Using Saxon 6, I get the expected result, that is: #1 attributes defined directly in my customisation (as you can see in the testcase, it does font-size="30pt") #2 attributes defined in the "use-attribute-setted" attribute-set (it does import the line-height="1.2em") #3 attributes defined by the original DocBook stylesheets (it uses font-weight="bold")
The parts of the XSLT spec regarding import precedence & attribute sets: http://www.w3.org/TR/xslt#dt-import-precedence http://www.w3.org/TR/xslt#attribute-sets [Final NB: the last part of comment 1 lists the rules that are expected & apparently used by Saxon in the correct order, but the explanation of #3 in parentheses is of course wrong, as that value should not be used at all.]
Created attachment 324537 [details] Simplified test case Created a simplified test case, so you don't have to have the DocBook machinery installed too.
Fixed with the following commit: https://git.gnome.org/browse/libxslt/commit/?id=ca9edf237f9925de4af809f0d5a0ed7e55bb6c82