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

Re: Indent based on position()

Subject: Re: Indent based on position()
From: "Brook Elgie" <brook.elgie@xxxxxxx>
Date: Fri, 12 Apr 2002 09:17:21 +0100
brooke elgie
Much thanx for a complete and thorough answer all!

brook

----- Original Message -----
From: "Kirk Allen Evans" <kaevans@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, April 11, 2002 8:57 PM
Subject: Re:  Indent based on position()


> Thanks, I was aware of that.  Sorry it was not explicitly stated as a
> limitation.
>
> Kirk Allen Evans
> kaevans@xxxxxxxxxxxxx
> "XML and ASP.NET", New Riders Publishing
> Available at Amazon.com
> http://www.amazon.com/exec/obidos/ASIN/073571200X/
>
>
> ----- Original Message -----
> From: "Greg Faron" <gfaron@xxxxxxxxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, April 11, 2002 9:13 AM
> Subject: Re:  Indent based on position()
>
>
> > At 09:10 AM 4/11/2002, you wrote:
> > ><xsl:stylesheet version="1.0"
> > >xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > ><xsl:output method="text"/>
> > ><xsl:template match="/">
> > >  <xsl:apply-templates select="content/line"/>
> > ></xsl:template>
> > ><xsl:template match="line">
> > >  <!-- Concatenate with a bunch of dashes -->
> > >  <xsl:variable name="dashes" select="'---------------------'"/>
> > >  <!-- Take the number of dashes corresponding to the line's position
> > > number -->
> > >  <xsl:value-of select="substring($dashes,1,position())"/>
> > >  <xsl:value-of select="."/>
> > >  <!-- Carriage-return-->
> > >  <xsl:text>&#10;</xsl:text>
> > ></xsl:template>
> > >
> > ></xsl:stylesheet>
> >
> >    Not commenting on the efficiency of this algorithm, the above will
only
> > work for a limited number of indentations (21 in this case).  If you're
> > going to use this method, you'll need to conditionally grow the string
as
> > in Jeni's str:padding template, located at
> > <http://www.exslt.org/str/functions/padding/str.padding.template.xsl>.
> >
> >
> >
> > Greg Faron
> > Integre Technical Publishing Co.
> >
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


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


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.