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

Re: html:br

Subject: Re: html:br
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 31 Mar 2003 23:32:23 +0100
html br
> So there is no way to create an "entity" (or similar) of a line break
> character then?

well yes that's what you did, but using the &lb; is the same as hitting
return on your keyboard: it inserts a newline char. You probably don't
want that, you probably want to insert an xsl:text node containing such a
thing, so you could if you want define lb to be 
<!ENTITY lb "<xsl:text>&#10;</xsl:text>">
but really, I wouldn't.

XSLT's white space stripping rules are rather simple once you get used
to them and after a while you just know that
<xsl:if test="...">
  <wibble/>

does not introduce space before <wibble/> but

<xsl:if test="...">
  wobble



does introduce a newline and two spaces before wobble as they are part
of a non-white text node, however if you hide things in entities


<xsl:if test="...">
  &lb;

Now you can't say if that newline and two spaces before the &lb; will
be stripped or not unless you go back and check exactly how you defined
&lb;.


and really you are not saving much typing:

<xsl:text>&#10;</xsl:text>

ain't so bad, you get used to typing
<xsl:template match="
100 times every stylesheet, you can get used to using xsl:text as
well:-)

David

 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.