Re: [xsl]   vs  

Subject: Re: [xsl]   vs  
From: "Michael Beddow" <mbnospam@xxxxxxxxxxx>
Date: Sat, 4 Aug 2001 08:30:42 +0100
Just a footnote on the &#160 issue that I think those who responded to
Alan took for granted, but may not be clear to everyone.

Alan, you asked about what will appear "in the resulting HTML". What
maybe needs clarifying is that your choice of notation in the XSLT for
the non-breaking-space character (whether &#160; &#x0a; or &nbsp; as an
entity declared in your internal or external subset) has no effect on
what will appear in the HTML output. I'm assuming you're specifying
output as html; in which case what turns up in the output is likely to
be &nbsp;, but *not* because of the notation you used in your XSLT. As
David M's reponse explains, whichever notation you use, the parser phase
will (=must) convert it into the same binary representation, which is
what gets handed to the XSLT transform phase and emerges in the output
tree of that phase. It's the final phase, serialisation of this tree
into HTML, where the back conversion happens.

The second point, arising from your apparent assumption that a normal
space character will have the same sort of effect in the HTML as a
non-breaking space, which other posters have corrected: wherever white
space issues are important in HTML output, the thing to do is to mock up
your desired results in HTML first, check the precise use/mix of white
space (in the XML spec sense) and &nbsp; that gets you the result you
want in your target browser(s), then work backwards from there to write
XSLT that generates that mix. The list archives are heavy with the woes
of people who tried to fix HTML white space issues entirely via XSLT
manipulations.

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