This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: outputting   to HTML (not so final answer)
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: Aniceto López <aniceto at overthenet dot tv>
- Cc: "xsl-list" <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 17 Dec 2001 16:12:04 +0000
- Subject: Re: [xsl] outputting   to HTML (not so final answer)
- Organization: Jeni Tennison Consulting Ltd
- References: <NFBBKOMALANALGBCPGHOAEEOCAAA.aniceto@overthenet.tv>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Aniceto,
> using "<xsl:output method="html"/> +   combination" I can have
> something like "<td> </td>" not "<td> </td>" as desired to
> solve the netscape cell problem
MSXML3 is serializing non-breaking space characters as native
characters (an actual non-breaking space character) rather than using
the HTML character entity reference ( ).
You can force MSXML3 not to use the native character by telling it to
serialize in an encoding which doesn't include the non-breaking space
character, for example ASCII:
<xsl:output encoding="US-ASCII" />
Unfortunately, MSXML3 does not use the HTML character entity reference
( ) even if it can't use the native character, but instead gives
a character reference:
<td> </td>
That's as close as you're going to get with MSXML3. Other processors
will use the character entity reference ( ) in these
circumstances.
But having tested in Netscape 4.74, whether you use a native
character, a character entity reference or a character reference makes
no difference - the table cell is rendered in exactly the same way.
It's only when you look at the source of the result file that you
might think that the native non-breaking space character was a normal
space rather than a non-breaking space.
> I can read in secction 2: "You can even declare nbsp in an internal
> subset of your stylesheet if you want a friendlier representation of
> the character" but I can't guess that it means
It means that you can use a DOCTYPE declaration in your stylesheet to
declare that the entity reference means the non-breaking space
character:
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp ' '>
]>
And then in your stylesheet you can use as much as you want, to
mean a non-breaking space character. However, this does not affect the
way the non-breaking space character is serialized in the result
document. Whether you use:
<td> </td>
<td> </td>
<td> </td> (where that 'space' is a non-breaking space)
makes no difference to the XSLT processor.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list