xsl-list
[Top] [All Lists]

global variables and more

2003-12-14 14:27:18
Hi,

I want to adjust the layout of my page (potrait or landscape), depending on how many entries I got in my xml.
If there are 5 or less entries potrait, 5+ entries landscape.

So I try to check first and create some global-variables and put in some values for the layout (page height, ...)


This approach doesn't work of course:
<xsl:choose>
 <xsl:when test="count(/ColumnNames/Column) &lt;= 5">
   <xsl:variable name="page-height">29.7cm</xsl:variable>
   <xsl:variable  name="page-width">21cm</xsl:variable>
   ...
 </xsl:when>
 <xsl:otherwise>
   <xsl:variable name="page-height">21cm</xsl:variable>
   <xsl:variable name="page-width">29.7cm</xsl:variable>
   ...
 </xsl:otherwise>
</xsl:choose>

But is there a way to do something like that?
I don't want to check a million times in my xsl (I have a lot of attributes depending on the kind of layout).

Thanks
Jonny

_________________________________________________________________
NEU: Polyphone Klingeltöne und farbige Logos für Ihr Handy! http://polyphonetoene.handy.msn.de Jetzt Handy aufpeppen!


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>