xsl-list
[Top] [All Lists]

Re: [xsl] xsl:use-attribute-sets, xslt 1.0, fo output

2011-01-19 07:59:43
On Wed, 19 Jan 2011 13:41:34 +0000
David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

On 19/01/2011 13:25, Dave Pawson wrote:
My objective was to keep all attribute sets

I've used xslt a bit from time to time,
No, go on!!!
 but I've never used attribute 
sets, they are more or less just a simple restricted cut down form of 
named template with a different calling convention, and if they are
too simple for your use case the easiest thing usually is to forget
they exist. So typically use a named template or variable, but in
your case since you want a dynamic dispatch use apply-templates.

<xsl:template match="@remap[.='LINE']">
   <xsl:attribute name="margin" select="3"/>
   <xsl:attribute name="color" select="#aabbcc"/>
</xsl:template>
...

<xsl:template match="speaker">
     <fo:block">
       <xsl:apply-templates select="@*|node()/>
     </fo:block>
</xsl:template>

David

Mmmm. 

I've just found out that I'm basically doing a Saxon with the
attribute sets. I'd have to interpret such things as
<xsl:attribute name="space-before.optimum">
     <xsl:value-of select="$title-sz"/> 
  </xsl:attribute>
which lets me build one on another, with dependencies right up to 
a single size for a base font size. 

which is more than I'm prepared to do.

Taking this idea... I think I can put all the styling in another
stylesheet (the attribute templates) and keep the isolation I want. 

I think I could use the variables to build up the set too...
You're just plain devious Mr C :-)

Thanks David. 



-- 

regards 

-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

--~------------------------------------------------------------------
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>
--~--