xsl-list
[Top] [All Lists]

RE: Conditionally use attribute sets?

2005-11-15 04:53:20
Hi,

I'm not sure I understand (in fact, I'm fairly sure I don't 
understand) If you really need an apply-import's like 
behaviour you can use a matching one in a special mode 
(matching a more or less arbitrary node, such as /)

Yes, but in most cases I don't want to match a node in some mode, but rather 
just say "add figure title formatting properties into this FO" and attribute 
sets suit that need perfectly. If an importing stylesheet wants to override 
only e.g. font weight, they don't have to redeclare the other attributes. 
Naturally I could have

<xsl:template match="figure/title">
  <fo:block>
    <xsl:apply-templates select="." mode="formatting-properties"/>
    <xsl:apply-templates/>
  </>
</>

<xsl:template match="figure/title"  mode="formatting-properties">
  <xsl:attribute name="font-size">10pt</>
</>

And the importing stylesheet could then just declare

<xsl:template match="figure/title"  mode="formatting-properties">
  <xsl:apply-imports/>
  <xsl:attribute name="font-size">10pt</>
</>

But thus far attribute sets have done the job even with the limitation of not 
being able to use them conditionally.

Jarno

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--