xsl-list
[Top] [All Lists]

Re: html:br

2003-03-31 15:32:23

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



<Prev in Thread] Current Thread [Next in Thread>