Note that there are some explanatory texts on larger screens.

plurals
  1. POxsl:attribute-set not inheriting from xsl:attribute-set correctly
    primarykey
    data
    text
    <p>I can't seem to get inheritance to work with xsl:use-attribute-sets. Michael Kay says in Chapter 6. XSLT Elements > xsl:attribute-set - Pg. 269 that </p> <blockquote> <p>If this combination of attributes is also used repeatedly, it could be defined as an attribute set in its own right, as:</p> <pre><code>&lt;xsl:attribute-set name="ruled-table" use-attribute-set="full-width-table"&gt; &lt;xsl:attribute name="border"&gt;2&lt;/xsl:attribute&gt; &lt;xsl:attribute name="rules"&gt;cols&lt;/xsl:attribute&gt; &lt;/xsl:attribute-set&gt; </code></pre> </blockquote> <p>EDIT 1: USE-ATTRIBUTE-SET INSTEAD OF USE-ATTRIBUTE-SETS IS PROBABLY A TYPO IN THE BOOK; I AM USING <em>XSL:USE-ATTRIBUTE-SETS</em></p> <p>This doesn't work for me. In other words, in my current setup [XSLT 2.0 via Apache Cocoon, importing styles.xsl into mypdf.xsl] the result of </p> <pre><code>&lt;table xsl:use-attribute-sets="ruled-table"&gt; &lt;tr&gt;...&lt;/tr&gt; &lt;/table&gt; </code></pre> <p>would be the <em>set difference</em> of the attribute sets <em>ruled-table</em> and <em>full-width</em>, not the precedent-mediated <em>set union</em> of the two attribute sets. I only get the directly named attribute, not the parent attribute set of the attribute set named. I can simulate the effect by doing something like this: </p> <pre><code>&lt;table xsl:use-attribute-sets="full-width-table ruled-table"&gt; &lt;tr&gt;...&lt;/tr&gt; &lt;/table&gt; </code></pre> <p>It seems however that this should be unnecessary. Has anyone run across this problem? Here's styles.xsl:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" exclude-result-prefixes="xsl xs fo"&gt; &lt;xsl:attribute-set name="fontstack"&gt; &lt;xsl:attribute name="text-align"&gt;left&lt;/xsl:attribute&gt; &lt;xsl:attribute name="font-size"&gt;10pt&lt;/xsl:attribute&gt; &lt;xsl:attribute name="font-family"&gt;"TradeGothic-CondEighteen", "Trade Gothic Cond Eighteen", "Trade Gothic Condensed Eighteen", "Trade Gothic", "TradeGothic", "Trade-Gothic", "ArialNarrow", "Arial-Narrow", "Arial Narrow", Arial, sans-serif &lt;/xsl:attribute&gt; &lt;xsl:attribute name="color"&gt;black&lt;/xsl:attribute&gt; &lt;/xsl:attribute-set&gt; &lt;xsl:attribute-set name="headers" xsl:use-attribute-sets="fontstack"&gt; &lt;xsl:attribute name="font-size"&gt;18pt&lt;/xsl:attribute&gt; &lt;xsl:attribute name="font-weight"&gt;bold&lt;/xsl:attribute&gt; &lt;xsl:attribute name="space-after"&gt;7pt&lt;/xsl:attribute&gt; &lt;xsl:attribute name="padding"&gt;12pt&lt;/xsl:attribute&gt; &lt;/xsl:attribute-set&gt; &lt;xsl:attribute-set name="h2" xsl:use-attribute-sets="headers"&gt; &lt;xsl:attribute name="padding"&gt;5pt&lt;/xsl:attribute&gt; &lt;/xsl:attribute-set&gt; &lt;xsl:attribute-set name="h3" xsl:use-attribute-sets="headers"&gt; &lt;xsl:attribute name="padding"&gt;2pt&lt;/xsl:attribute&gt; &lt;/xsl:attribute-set&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload