xsl-list
[Top] [All Lists]

Re: [xsl] strip-spaces

2008-02-04 23:41:36

Just a brief note as much for people that may in the future search this thread.

I changed my templates to generate the troublesome divs later in the document - and it both fixed my problem in IE and made the code validate as XHTML strict requiring only that I remove the xmlns="" that is generated on nodes by the XSL serializer.

This issue came up early last month. Michael responded to the question then and David discusses it below in my case - but I confess that I don't yet follow the interdependencies in these name spaces or understand why the serializers put in the erroneous empty namespace assignments.

I thought I understood XML namespaces but obviously not when it comes to the intertwining with XHTML. Especially when given that an xhtml document "is not xml," why there should be an xmlns issue at all.

If you are generating xhtml output and you create a result node - should it not simply be the case that it is in the xhtml name space. If the answer is that xml namespaces can be interleaved with xhtml - then why isn't that always something that is explicitly specified by the template and not something implicit as it seems to be.

With respect,
Steven


On Feb 4, 2008, at 3:42 PM, Steven Ericsson-Zenith wrote:


My thanks for this review - obviously, I need to spend more time with these issues. I had assumed that the div's, as specified (i.e., display:none) where outside of the text flow - I'll have to review how much I can do inline. I had relied upon the browser based debuggers and they gave me green lights.

As you say, this is all outside of the XSL issues and the list - but I do appreciate the pointers and the validator uri - I should have known about that.

Thanks.

With respect,
Steven





On Feb 4, 2008, at 3:29 PM, David Carlisle wrote:




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.
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>