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

RE: Tricky White Spaces being ignored

Subject: RE: Tricky White Spaces being ignored
From: Jarno.Elovirta@xxxxxxxxx
Date: Mon, 1 Mar 2004 08:40:40 +0200
tricky white
Hi,

> I have the following (example) template rule(s) along with 
> the outputed
> result (surrounded by ==== to show where output begins and ends:
> 
> <xsl:template match="br">&#10;&#13;</xsl:template>
> ====Dear Mr. Schmidt, We would like to take this opportunity to...====
> 
> <xsl:template match="br">&#10;&#13;x</xsl:template>
> ====Dear Mr. Schmidt,
> 
> x
> xWe would like to take this opportunity to...====
> 
> <xsl:template match="br">&#10;x</xsl:template>
> ====Dear Mr. Schmidt,
> xWe would like to take this opportunity to...====
> 
> (last example is closest to right)
> 
> NOTE:  The only way I get these &#10; or &#13; to create a 
> line break in my
> textarea is if I include a real character (character "x" above) in the
> template rule.  Then it works fine.  What gives?  It is 
> almost like the
> template rule is ignored otherwise.

The white space is stripped, see <http://www.w3.org/TR/xslt#strip>. Wrap the LINE FEED character into xsl:text:

  <xsl:template match="br">
    <xsl:text>&#xA;</xsl:text>
  </xsl:template>

Cheers,

Jarno

 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.