xsl-list
[Top] [All Lists]

Using <xsl:for-each> and position() to increase indent in each iteration

2005-05-12 16:47:52
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--