You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Per Ced <pe...@gmail.com> on 2008/04/15 12:48:42 UTC

Default namespace and xsl:element in version 1.10

Hi,

Has upgraded xalan-c from version 1.4 to 1.10 and noticed that
default namespace is not shown in the result document, compared to the old
xalan version,
when using the <xsl:element>
Is it a bug or a fix in the new version?

For ex.

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml">
  <xsl:template match="/">

    <xsl:element name="html">
    </xsl:element>

  </xsl:template>
</xsl:stylesheet>


Gives the output (in version 1.10):

<html></html>

And not the expected one (as in version 1.4):

<html xmlns="http://www.w3.org/1999/xhtml"></html>

Thanks in advance!!

Re: Default namespace and xsl:element in version 1.10

Posted by David Bertoni <db...@apache.org>.
Per Ced wrote:
> Hi,
>  
> Has upgraded xalan-c from version 1.4 to 1.10 and noticed that
> default namespace is not shown in the result document, compared to the 
> old xalan version,
> when using the <xsl:element>
> Is it a bug or a fix in the new version?
Hmm, I though it was a fix, but perhaps it a bug after all.  I'll need 
to do some research into the history, since I remember this coming up.

The XSLT recommendation is explicit:

http://www.w3.org/TR/xslt#section-Creating-Elements-with-xsl:element

"The name attribute is interpreted as an attribute value template. It is 
an error if the string that results from instantiating the attribute 
value template is not a QName. An XSLT processor may signal the error; 
if it does not signal the error, then it must recover by making the the 
result of instantiating the xsl:element element be the sequence of nodes 
created by instantiating the content of the xsl:element element, 
excluding any initial attribute nodes. If the namespace attribute is not 
present then the QName is expanded into an expanded-name using the 
namespace declarations in effect for the xsl:element element, including 
any default namespace declaration."

So it seems to me we should be adding a namespace node for the default 
namespace.  Can you please open a Jira issue so we can track this?

Dave