Re: [xsl] strip-spaces

Subject: Re: [xsl] strip-spaces
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Feb 2008 23:29:16 GMT
> I'd like to understand the namespace issues.

xhtml is in the namespace http://www.w3.org/1999/xhtml, xhtml isn't XML
so isn't in a namespace at all as xml namespaces are an XMl construct,
but in XSLT one constructs HTML by constructing an XML tree in
no-namespace and then using the html output method to output that as
html rather than xml.

You have a mixture of elements in xhtml and no-namespace, your document
starts

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"><head
xmlns="">

so html is in the XHTML namespace but head (and its child meta and
script elemnents) are in no namespace then body and table are back in
the xhtml namespace but most (all?)  p elements are in no-namespace.

As such you are relying on error recovery of the browser to get display
so it wouldn't be that surprising if this differs between browsers.

As you are sending it as text/html the document will be parsed as HTML
rather than XML so the reference to the XHTML DTD, and use of XML syntax
such as xmlns="" and <br/> rather than <br> are again syntax errors (or
in the case of <br/> unwanted syntax as it should typeset a > after the
break) it may be better to generate html rather than xhtml unless you
specifically need xml features (for MathMl for example).

Actually I now see the line breaks differences, I suspect these aren't
directly related to the namespace issues but just that the html is
invalid  (you can;t have a p in a span for example) so rendering isn't specified.
FF sees to render it all in one para, IE throws a line break and Opera
generates a blank line in the first section

    The present inquiry explores a 
    ----- here -----
    constructive explanation


the w3c's html validator reports several problems

http://validator.w3.org/check?uri=http%3A%2F%2Fsenses.info%2Fexplaining-experience-in-nature%2Fintroductory-remarks

but fixing those is off topic for this list.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread