Subject: Re: [xsl] in XSL other than d-o-e ? From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Fri, 19 Jul 2002 10:32:47 +0100 |
Hi Jochen, > So know I'm wondering if there's an other way using > in an XSL-Stylesheet without using d-o-e > > This is the way I do it right now: > <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> > > Is there another, much easier way? The easiest way of getting a non-breaking space into your output is to use the character reference for a non-breaking space in your stylesheet. Simply use:   or:   When the XSLT processor serialises the result tree as HTML, it will see the non-breaking space character and serialise it as a non-breaking space character or as the character reference   or   or as the entity reference . Whichever of those it does, you'll get a non-breaking space displayed when you view the HTML document in a browser (so you shouldn't really worry about which it uses). If you want to force the processor to use an character or entity reference (so that you can see the non-breaking space when you view the source of the output) then tell it to use ASCII encoding: <xsl:output encoding="ASCII" /> The non-breaking space character isn't in the ASCII character set, so it has to be output using an entity or character reference. If you don't want to have   or   in your stylesheet, then you can declare a 'nbsp' entity in its place: <?xml version="1.0"?> <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp ' '> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> ... </xsl:stylesheet> That will enable you to use in the stylesheet whenever you want a non-breaking space in the output. (But it won't guarantee that you'll get " " in the output.) Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] in XSL other than , Julian Reschke | Thread | Re: [xsl] in XSL other than , David Carlisle |
Re: [xsl] keep and breaks for fo:ta, Siarhei Baidun | Date | RE: [xsl] in XSL other than , Jarno . Elovirta |
Month |