[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Conditionally use attribute sets?

Subject: RE: Conditionally use attribute sets?
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Tue, 15 Nov 2005 13:53:20 +0200
RE:  Conditionally use attribute sets?
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.