OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] How to specify an attribute-set?


True, you can't pass in attribute-sets from the command line, but you
can use params and other logic as the value of an attribute in an
attribute set. This doesn't handle every case (e.g. you can't not set
the attribute value), but it may help in some cases:

<xsl:attribute-set name="formal.title.properties"
use-attribute-sets="normal.para.spacing">
  <xsl:attribute name="font-weight">
	  <xsl:choose>
		<xsl:when test="self::figure or
self::table">bold</xsl:when>
		<xsl:otherwise>normal</xsl:otherwise>
	  </xsl:choose>
	</xsl:attribute>
  <xsl:attribute name="font-size">
    <xsl:text>14pt</xsl:text>
  </xsl:attribute>
  <xsl:attribute name="hyphenate"><xsl:value-of
select="$my.param"/></xsl:attribute>
  <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
  <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
  <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
</xsl:attribute-set> 

Alternatively, you could have several customizations that each have
different attribute set combinations and have ant pick the right one. Or
you could go completely insane and have ant run an xslt that generates
the attribute-set piece of your customization layer based on some params
you pass in to it and then use the generated customization layer to
process your doc ;-)

David

> -----Original Message-----
> From: tom_schr@web.de [mailto:tom_schr@web.de] 
> Sent: Friday, December 29, 2006 4:49 PM
> To: docbook-apps@lists.oasis-open.org
> Subject: Re: [docbook-apps] How to specify an attribute-set?
> 
> Hi Trevor,
> 
> On Friday 29 December 2006 23:05, Trevor Harmon wrote:
> >
> > I'm using DocBook XSL to transform a DocBook file to FO, and I'm 
> > customizing the output via user-configurable parameters [1]. For 
> > instance, if I want to prevent URLs from appearing after 
> the text of a 
> > ULink, I can set the ulink.show parameter [2].
> >
> > Specifying these parameters is easy enough. When using 
> Ant's Xslt task 
> > [3], for instance, I can simply add <param> sub-elements.
> > Likewise, when calling Saxon from the command line, I can 
> just add the 
> > parameters as command line arguments.
> >
> > I recently discovered that some of the FO parameters, such as 
> > formal.title.properties [4], are not so simple; they're structured.
> > That is, instead of a key/value pair, they're specified as an 
> > attribute-set. How is one supposed to specify these attribute-sets 
> > when using Ant or Saxon? I couldn't find any documentation 
> or examples 
> > on how to do this.
> 
> I fear it is not possible to add an attribute set on a command line.
> 
> I am not very familiar with Ant but as fas as I understood 
> it, you need a customization layer (see [1,2]).  Simply said, 
> you create a XSLT stylesheet, import the original DocBook 
> stylesheet, move your parameters from your Ant task to the 
> customization layer and add your attribute sets.
> 
> Delete all <param> in your Ant task and use your customized 
> stylesheet instead the original one. Hope it's clear from 
> this rough description. :)
> 
> 
> Hope that helps,
> Tom
> 
> ----------
> [1] 
> http://www.sagehill.net/docbookxsl/CustomMethods.html#Customiz
> ationLayer
> [2] http://www.sagehill.net/docbookxsl/AttributeSets.html
> 
> -- 
> Thomas Schraitle
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: 
> docbook-apps-help@lists.oasis-open.org
> 
> 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]