xsl-list
[Top] [All Lists]

Re: MSXML / NBSP problem and resolution

2002-11-08 05:10:31
David Carlisle wrote:
me> No it is _mandated_ to add a meta element  by the XSLT spec.

you> Actually, it's a "should" in the spec.

so it is. I wonder why. (If any system can do html output at all I'd have
thought it could easily do this)

I can think of 2 reasons why it's a should.

One is that the XSLT engine isn't necessarily encoding the output. It could
pass the HTML as Unicode to another process, which may or may not take care of
encoding it as bytes somewhere down the line. So it can't guess at what
encoding, if any, should be "declared" in the HTML document. On the other
hand, XML has the same problem, and the solution is that the processing APIs
(SAX for example) state that if the document is being received as Unicode,
then the encoding declaration is ignored, so it doesn't matter what it says.

The other more pressing reason is that if you are starting the serialization
of each node of the result tree as soon as it is added, which is what many
XSLT processors attempt to do, you have to keep state while outputting the
contents of the <head> element, in order to know whether you've reached the
end and haven't yet output a <meta http-equiv="Content-Type">. That might be
more work than the spec wants to require of an XSLT processor.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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