Bug #5861
closed
xsl:copy-of copy-namespaces="no" fails with various tree models
Category:
XSLT conformance
Applies to branch:
10, 11, 12, trunk
Fix Committed on Branch:
10, 11, 12, trunk
Fixed in Maintenance Release:
Description
New unit test added to ObjectModelTests.java to test xsl:copy-of with assorted tree models.
The test with copy-namespaces="no" is crashing with the Linked Tree model. The test was prompted by bug #5859 (using the DOM model) and the failure will probably occur with any tree model that uses the generic Navigator.copy() method.
Failure symptoms in 12.0:
java.lang.IllegalStateException: Prefix p has not been declared
at net.sf.saxon.event.RegularSequenceChecker.startElement(RegularSequenceChecker.java:361)
at net.sf.saxon.event.ComplexContentOutputter.startElement(ComplexContentOutputter.java:535)
The problem is that Navigator.copy() (with copy-namespaces="no") invokes the 6-argument ComplexContentOutputter.startElement() method with an empty namespace map; this method does not do namespace fixup, so the namespaces that are actually used in the element and attribute names do not get declared.
- Subject changed from xsl:copy-of copy-namespaces="no" fails with linked tree model to xsl:copy-of copy-namespaces="no" fails with various tree models
It fails with the LinkedTree, but this has its own implementation of ElementImpl.copy() which needs to be fixed separately,
After changing Navigator.copy()
to gather the namespaces used on the element being copied and its attributes, the new tests are working for all tree models except the LinkedTree.
Now fixed for the LinkedTree as well; new tests working on all tree models.
Need to
- regression test;
- back-port the bug fix and the tests to 11.x and 10.x branches
- port the test (and if necessary the bug fix) to SaxonCS.
- Status changed from New to In Progress
- Category changed from Internals to XSLT conformance
- Fix Committed on Branch 10, 11, 12, trunk added
- Platforms Java added
Fully resolved for SaxonJ.
Need to check for SaxonCS.
- Status changed from In Progress to Resolved
- Platforms .NET added
I have converted the JUnit ObjectModelTests to C# NUnit, with implementations for TinyTree, LinkedTree, Dom, and LINQ.
I'm seeing one or two failures - notably the DocumentOrder tests - but the XSLT copy-of tests are succeeding so we can now close this issue. (Note that the failure would have occurred before transpiling the code with the Java patches applied.)
Note, I haven't specifically tested on SaxonCS 11, but the changes to the Java code are exactly the same and I think we can be confident that it will work when transpiled.
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.5 added
Bug fix applied in the Saxon 11.5 maintenance release.
- Fixed in Maintenance Release 10.9 added
Bug fix applied in the Saxon 10.9 maintenance release. Leaving bug issue marked as resolved until applied in the next Saxon 12 maintenance.release.
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 12.1 added
Bug fix applied in the Saxon 12.1 maintenance release.
Please register to edit this issue
Also available in: Atom
PDF