Next in thread →
Next in month →
Re: [docbook-apps] personalize xsl docbook
Hi,
The problem is that in XSL syntax, you cannot set a parameter inside an
xsl:choose statement, because it goes out of scope when the xsl:choose
closes. You have to put the choose statement inside the parameter:
<xsl:param name="column.count.body">
<xsl:choose>
<xsl:when test='$var1="2"'>2</xsl:when>
<xsl:when test='$var1="1"'>1</xsl:when>
</xsl:choose>
</xsl:param>
You might want to add an xsl:otherwise statement to catch any bad input
values.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
----- Original Message -----
From: "brice rouanet" <>
To: <>
Sent: Tuesday, March 15, 2005 11:59 PM
Subject: [docbook-apps] personalize xsl docbook
> Hi,
>
> I want to use docbook to generate a fo doc and convert it in pdf with XEP.
>
> In my documents I have differents chapters,
> chapter have attibute ("type") which is define
> if it will be on one or two columns;
>
> I not arrived to convert my xml in fo with this particularity,
> here you cans see my xsl :
>
>
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:import
> href="/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl"/>
>
> <xsl:param name="paper.type" select="'A4'"/>
>
> <xsl:param name="column.count.titlepage" select="2"/>
> <xsl:param name="column.count.body" select="2"/>
>
> <xsl:template match="chapter">
>
> <xsl:variable name='var1' select='@type'/>
>
> <xsl:choose>
> <xsl:when test='$var1="2"'>
> <xsl:param name="column.count.body" select="2"/>
> </xsl:when>
> <xsl:when test='$var1="1"'>
> <xsl:param name="column.count.body" select="1"/>
> </xsl:when>
> </xsl:choose>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
> And here a xml example :
>
> ....
> <chapter type=1>
> .....
> <!-- one column page -->
> .....
> </chapter>
> .....
>
> ....
> <chapter type=2>
> .....
> <!-- two columns page -->
> .....
> </chapter>
> .....
>
> ....
> <chapter type=1>
> .....
> <!-- one column page -->
> .....
> </chapter>
> .....
>
> This not work :(
> if you have an idea ?
>
> Thanks for your help.
>
> --
> Brice Rouanet
> I.N.S.A. Centre de Ressources Informatiques
> Complexe Scientifique 135 Avenue de Rangueil
> 31077 Toulouse Cedex4 (France) tel 0561559374
>
>
>
Next in thread →
Next in month →