Bug #5861
closedxsl:copy-of copy-namespaces="no" fails with various tree models
100%
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.
Updated by Michael Kay almost 2 years ago
- 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,
Updated by Michael Kay almost 2 years ago
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.
Updated by Michael Kay almost 2 years ago
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.
Updated by Michael Kay almost 2 years ago
- Status changed from New to In Progress
Updated by Michael Kay almost 2 years ago
- 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.
Updated by Michael Kay almost 2 years ago
- 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.)
Updated by Michael Kay almost 2 years ago
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.
Updated by O'Neil Delpratt almost 2 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.5 added
Bug fix applied in the Saxon 11.5 maintenance release.
Updated by O'Neil Delpratt almost 2 years ago
- 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.
Updated by O'Neil Delpratt over 1 year ago
- 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