[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: 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
increase indent
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.