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

[xsl] Using and position() to increase indent in each iteration


Subject: [xsl] Using <xsl:for-each> and position() to increase indent in each iteration
From: "David Gadd" <David.Gadd@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 May 2005 16:47:52 -0700

Hi,

I'm new to the list and fairly new to XSL.

I am wanting to use the position() function to increase the indent in an
<xsl:for-each> iteration by 3 spaces, using the following logic, but
preferably without using a case statement:

position() == 1 > generate ""
position() == 2 > generate "&nbsp;&nbsp;&nbsp;"
position() == 3 > generate "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
position() == 4 > generate
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
etc
etc

As a separate issue, when I use &nbsp; in my xsl template it seems to fail
(the &nbsp; disappears).

By googling I found a suggestion to use &#160; instead.

Is there a reason why &nbsp; is not working?

Thanks very much,

David Gadd


Current Thread
Keywords
xsl