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

RE: Text output: CR LF

Subject: RE: Text output: CR LF
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 15 Dec 2004 15:35:29 -0000
xsl text output
To output whitespace, write it as (for example):

<xsl:text>&#xd;&#xa;</xsl:text>

In any other context, a whitespace text node in the stylesheet has no effect
- even if it is written using character references such as &#xd;.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: news@xxxxxxxxxxx [mailto:news@xxxxxxxxxxx] 
> Sent: 15 December 2004 14:13
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  Text output: CR LF
> 
> Hello List,
> 
> I m trying to transform an XML document into plain text using 
> Saxon on a Win
> XP system.
> There for I defined a output element:
> <xsl:output method="text" media-type="text/plain" 
> encoding="iso-8859-1"/>
> 
> My problem is, that I dont get carriage returns and line 
> feeds where I want
> them to be (mostly I dont get them at all).
> 
> For example:
> <XML>
> 	<NODE1>
> 		<NODE2>
> 			<NODE3>a row</NODE3>
> 		</NODE2>
> 		<NODE2>
> 			<NODE3>a row</NODE3>
> 		</NODE2>
> 	</NODE1>
> </XML>
> 
> I have a template matching to 'NODE1'
> 
>   <xsl:template match="NODE1">
>     <xsl:apply-templates select="//NODE2" mode="abc"/>
>   </xsl:template>                        
> 
> applying over all 'NODE2' nodes. Within this node, I want 
> 'NODE3' as a row. 
>   
>   <xsl:template match="NODE2" mode="abc">
> 	<xsl:value-of select="*//NODE3"/>&#xD;
>   </xsl:template>
> 
> What I get is:
> a rowarow
> 
> What I want is:
> a row
> a row
> 
> What are I m doing wrong? Can you help me?
> Thanks, Jan

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.