[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: Re: [xsl] xsl:use-attribute-sets, xslt 1.0, fo output
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 19 Jan 2011 13:41:34 +0000

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


________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________



Current Thread
Keywords