This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Whitespace in XSL not appearing if method="xml"
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Whitespace in XSL not appearing if method="xml"
- From: "Michael Beddow" <mbnospam at mbeddow dot net>
- Date: Tue, 7 Aug 2001 17:16:16 +0100
- References: <OF605E8C0B.0FA0722D-ON05256AA1.0051EA12@db.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
On Tuesday, August 07, 2001 4:12 PM
Eliyahu Hershfeld wrote:
> My XSL has   and <xsl:text> </xsl:text> in a few places.
> I would like these to appear as   in the output.
> When I do a transform using <xsl:output method="xml">
> I just get an empty space instead of  
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,   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