Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-1156

Redirect does not output xmlns declaration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 2.4Dx
    • None
    • Xalan-extensions
    • None
    • Operating System: Windows NT/2K
      Platform: PC
    • 12114

    Description

      Namespace nodes are not output when using redirection. That is, when the
      generated root element is redirected, it receives the correct xmlns declaration.
      But when another element is redirected to a new file (becoming that file's root
      element), then that element does not get its necessary namespace nodes.

      Example:
      [source]
      <root xmlns="foo"><test/></root>

      [xsl]
      <xsl:template match="test">
      <redirect:write file="newfile.xml">
      <xsl:copy/>
      </redirect:write>
      </xsl:template>

      [actual newfile.xml]
      <?xml ...>
      <test/>

      [expected newfile.xml]
      <?xml ...>
      <test xmlns="foo"/>

      I set this bug to Major severity because the resulting file is not XML namespace
      compliant and the workaround (see below) is not acceptable by everyone.

      Look also in the Xalan-J-user mailing list for a thread with title "redirect
      does not output xmlns declaration".

      Attachments

        Activity

          People

            Unassigned Unassigned
            benoit@synclude.com Benoit Maisonny
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: