[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Whitespace in XSL not appearing if method="xml"


Subject: Re: [xsl] Whitespace in XSL not appearing if method="xml"
From: "Michael Beddow" <mbnospam@xxxxxxxxxxx>
Date: Tue, 7 Aug 2001 17:16:16 +0100

On Tuesday, August 07, 2001 4:12 PM
Eliyahu Hershfeld wrote:

> My XSL has &#160; and <xsl:text>&#160;</xsl:text> in a few places.
> I would like these to appear as &#160; in the output.
> When I do a transform using <xsl:output method="xml">
> I just get an empty space instead of &#160;

As Mike Kay has pointed out, you are almost certainly seeing the glyph
that corresponds to NO-BREAK-SPACE in the output encoding of your choice
(or the default utf-8 if you didn't specify one) This is perfectly
correct behaviour. Why is it a problem? Any subsequent XML processor
will not object to it, provided the encoding is correcly specified or
defaulted.

If you want to try to force the Xalan serialiser to use the numeric
reference, you might try specifying your output encoding as us-ascii. I
don't know if this would work (I've never tried, because I've never seen
the need). Oh, and please, &#160; isn't white space in XML-speak. It
specifies an abstract character that happens to be "white" (or whatever
the background colour of your rendering medium happens to be), and any
conformant XML processor must treat it like any "non-white" character,
*not* like white space.

Michael
---------------------------------------------------------
Michael Beddow   http://www.mbeddow.net/
XML and the Humanities page:  http://xml.lexilog.org.uk/
---------------------------------------------------------


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords