Project

Profile

Help

Bug #4666

closed

Different xmlns (Saxon 10.1 and 9.9)

Added by Air Quick over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2020-08-03
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, trunk
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:

Description

Given these files, Saxon 10.1 behaves differently from 9.9.

$ cat source.xml 
<?xml version="1.0" encoding="UTF-8"?>
<p><q/></p>
$ cat stylesheet.xsl 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:w="w-uri" xmlns:x="x-uri"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output indent="yes" omit-xml-declaration="yes" />

  <xsl:mode on-multiple-match="fail" on-no-match="shallow-copy" />

  <xsl:template as="element(x:report)" match="/">
    <xsl:message select="('xsl:product-name', 'xsl:product-version') ! system-property(.)" />

    <xsl:variable as="element(p)" name="var">
      <xsl:apply-templates />
    </xsl:variable>

    <xsl:element name="report" namespace="x-uri">
      <xsl:sequence select="$var" />
    </xsl:element>
  </xsl:template>

  <xsl:template as="element(w:s)" match="q">
    <xsl:element name="w:s" namespace="w-uri" />
  </xsl:template>

</xsl:stylesheet>
$ java -jar SaxonHE10-1J/saxon-he-10.1.jar -s:source.xml -xsl:stylesheet.xsl
SAXON HE 10.1
<report xmlns="x-uri">
   <p xmlns="">
      <w:s xmlns="x-uri" xmlns:w="w-uri"/>
   </p>
</report>
$ java -jar SaxonHE9-9-1-7J/saxon9he.jar -s:source.xml -xsl:stylesheet.xsl
SAXON HE 9.9.1.7
<report xmlns="x-uri">
   <p xmlns="">
      <w:s xmlns:w="w-uri"/>
   </p>
</report>

10.1 puts xmlns="x-uri" in <w:s>, whereas 9.9 doesn't. I wonder which is correct.

Please register to edit this issue

Also available in: Atom PDF