Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-672

Missing default namespace when using <xsl:element> in version 1.10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • XalanC
    • None
    • Tested with testXSLT on AIX.

    Description

      The default namespace is not shown in the result document, compared to the old
      xalan version, when using the <xsl:element>

      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>

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cedde Per cederin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: