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

Re: Text file Indentation

Subject: Re: Text file Indentation
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Tue, 12 Feb 2002 01:19:11 -0800
xsl output text file
indent="yes" only applies to XML output mode, IIRC, and it isn't even 
guaranteed to be supported.  What your problem is is that XSLT by default 
does not output the whitespace between template elements.  What you want is 
to use the <xsl:text>     </xsl:text> element to tell the processor to not 
ignore the whitespace.  As an alterative, you can experiment with setting 
xml:space="preserve" on any of your elements, which will do the same thing 
(but can have undesired consequences).

On Monday 11 February 2002 23:45, Yoav Broudo wrote:
> Hi,
> I am outputting my XSL as text and I need to Indent is as the example
> bellow. How can I achieve Indentation in a Text format.
> I am trying to use the <xsl:output method="text" indent="yes"/> but it
> seems like the parser ignore the Indent keyword.
>
> Thanks in advance
> Yoav
>
>
> I am using the following XSL:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"
> indent="yes"/>
> <xsl:template match="USER">
> <document>
> Hi <xsl:value-of select="@USER_NAME"/>&#xA; <!-- CR -->
> We have the following postings....
> &#xA; <!-- CR -->
> 	<xsl:for-each select="CATEGORY">
> <xsl:number count="CATEGORY"/>. <xsl:value-of select="@TITLE"/>
> (http://mysite.com/document.aspx?id=<xsl:value-of select="@ID"/>)
> <xsl:for-each select="CONTENT_ITEM">
> 				<xsl:number count="CONTENT_ITEM" format="a"/>. <xsl:value-of
> select="@TITLE"/> (http://mysite.com/document.aspx?document=<xsl:value-of
> select="@ID"/>) </xsl:for-each>&#xA; <!-- CR -->
> 	</xsl:for-each>
> Regardsss
> 	Administrator
> </document>
> </xsl:template>
> </xsl:stylesheet>
>
>
> The Output should look like:
>
> Hi Joe
>
> We have the following postings...
>
>  1. Post A (http://mysite.com/document.aspx?id=1)
> 		a. Subject A (http://mysite.com/document.aspx?document=1)
>
>  2. Post B (http://mysite.com/document.aspx?id=5)
> 		a. Subject B (http://mysite.com/document.aspx?document=45)
> 		b. Subject D (http://mysite.com/document.aspx?document=10)
> 		c. Subject F (http://mysite.com/document.aspx?document=11)
> 		d. Subject G (http://mysite.com/document.aspx?document=12)
>
>  3. Post C (http://mysite.com/document.aspx?id=6)
> 		a. Subject A (http://mysite.com/document.aspx?document=13)
> 		b. Subject C (http://mysite.com/document.aspx?document=15)
> 		c. Subject E (http://mysite.com/document.aspx?document=16)
>
>  4. Post D (http://mysite.com/document.aspx?id=7)
> 		a. Subject D (http://mysite.com/document.aspx?document=14)
>
>
> Regardsss
> 	MFA Administrator
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
Peter Davis
What's the difference between a computer salesman and a used car salesman?

A used car salesman knows when he's lying.

 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.