Re: [xslt] re: <br></br> empty elements

On Tue, May 20, 2003 at 05:17:56PM +0100, Peter Robins wrote:
> <?xml version="1.0"?>
>    <xsl:stylesheet version="1.0"
>        xmlns:xsl="";
>        xmlns="";>
>      <xsl:output method="html"/>
>      <xsl:template match="/">
> 	<html>
>        <br/>
>        <br></br>
>        </html>
>      </xsl:template>
>    </xsl:stylesheet>
> and you get 
> <html 
> xmlns="";><br></br><br></br></html>
> Agreed, for my purposes, I can easily remove the namespace 
> declaration, but as the default output for method=html is 4.0, output 
> with and without namespace declaration should be identical, shouldn't 
> they?

  Either you want to save XHTML or you want to save HTML.
The rules are not the same. XHTML1 serialization rules are for
output="xml" and the proper DOCTYPE set-up , or you use 
output="html" and in that case the XML is generated in the normal
way any XML would, and this includes nodes with namespaces.
  <html xmlns="";>
are 2 totally different nodes in that case. The first one is an 
HTML and hence SGML node serialized for HTML4.01 targets. In the
second case it is an XML node with a namespace and the serialization
rules are the ones of XML in that context.
  So no "output with and without namespace declaration should be identical"
is just plain wrong !


Daniel Veillard      | Red Hat Network  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]