RE: xslt20/#xhtml-output : suggestion for additional item: "only one ns decl"

I don't think a serialization option that required look-ahead would be a
particularly good idea, and I don't think it's right that serialization
should output an XML document that is not a faithful representation of the
result tree.

I also think that your suggestion is quite hard to specify precisely. Are
you suggesting that elements and attributes should be somehow be treated as
if they were in the XHTML namespace when they are not?

We have done quite a lot in XSLT 2.0 to make it easier to avoid
proliferation of namespaces in the result tree. There is now an option #all
on exclude-result-prefixes, and there is the option copy-namespaces="no" on
xsl:copy. I think these features should reduce the usability problems in
generating XHTML.

Michael Kay


> -----Original Message-----
> From: Tobias Reif [mailto:tobiasreif@pinkjuice.com] 
> Sent: 13 February 2003 16:28
> To: public-qt-comments@w3.org
> Subject: xslt20/#xhtml-output : suggestion for additional 
> item: "only one ns decl"
> 
> 
> 
> Hi
> 
> I think it would make sense to add the following to 
> http://www.w3.org/TR/xslt20/#xhtml-output
> 
> ######################################################################
> 
>    * [other HTML compatibility items]
>    * If the whole document is in the XHTML namespace, the serializer
>      should add only one namespace delaration, on the root element.
> 
> ######################################################################
> 
> (No additional redundant XHTML namespace delarations, no null 
> namespace 
> delarations, and no other namespace delarations at all.)
> 
> This would increase "HTML compatibility". Older browsers and 
> validators 
> often get confused if there are many other namespace 
> delarations in many 
> other locations. My current workaround is to not qualify any result 
> fragments (I simply don't declare the XHTML namespace anywhere), then 
> insert a single namespace declaration on the root element, 
> via a script.
> 
> I think there should be a solution offered by the XSLT2 spec; any way 
> which achieves what I describe is OK.
> 
> One solution addressing pipelining issues could be to write 
> s.th. like 
> the following:
> 
> ######################################################################
> 
> [attributes of element output]
> 
> Attribute single-ns-decl defaults to "no".
> 
>        Beware: If single-ns-decl="yes",
>        serialization can not be pipelined.
> 
> [#xhtml-output]
> 
>    * [other HTML compatibility items]
>    * If the whole document is in the XHTML namespace, the serializer
>      should add only one namespace delaration, on the root element.
>      In other words:
>      method="xhtml" sets single-ns-decl="yes", but it can be reset
>      by explicitly specifying single-ns-decl="no", eg to allow for
>      pipelining.
> 
> ######################################################################
> 
> AFAICS some solution must be found, if xslt20/#xhtml-output 
> is to really 
> address the needs of those who serve "HTML compatible" XHTML.
> 
> TIA,
> Tobi
> 

Received on Thursday, 13 February 2003 14:02:20 UTC