Project

Profile

Help

Bug #1592

closed

Namespace handling of output xml documents

Added by David Hume over 12 years ago. Updated over 11 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
2012-07-19
Due date:
% Done:

0%

Estimated time:
Platforms:

Description

Executing a transform like:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:foo="bar"
  version="2.0">

  <xsl:output method="xml" indent="yes" />

  <xsl:template match="/">
    <foo:bar foo:me="1">
      <testing>
        <foo:foo />
      </testing>
    </foo:bar>
  </xsl:template>
  
</xsl:transform>

with Saxon.serializeToXML(processor.transformToDocument(input))

results in:

<bar xmlns="bar" foo:me="1" xmlns:foo="bar"><testing><foo/></testing></bar>

Which is broken; testing is in the wrong namespace.

Also elements always receive namespaces via "default" declarations, and other namespace declarations are dropped, which makes it challenging to generate xsl stylesheets as a first pass transform since namespaces such as ixsl (used in xpath expressions) are dropped (replaced with a default xmlns binding only on those elements in the ixsl namespace).

Please register to edit this issue

Also available in: Atom PDF