Bug #5616
closedSaxonCS 11.3.0 - Namespace missing for elements copied using copy-namespaces="no"
100%
Description
I am doing POC on SaxonCS (11.3.0) .net core to upgrade the legacy Saxon9he library with new SaxonCS 11.3.0.
I am using copy-of function in XSLT where expectation is copy the current node and all child nodes with namespaces but namespace were missing for some child nodes thus it generate error for us. Please have a look below error and suggest.
System.Xml.XmlException : 'qri' is an undeclared prefix. Line 2, position 5.
I have attached XSLT, input xml , Previous Output xml (Saxon9he library) and New Output xml (SaxonCS 11.3.0) for your reference
Files
Updated by Michael Kay over 2 years ago
Thanks for reporting it.
How are you running the transformation: Command line or C# API? If the latter, how do you supply the input, and what kind of output destination do you use?
Running from the command line, and with the current 11.x development branch, I'm seeing a failure with different symptoms: it's failing with Saxon.Ejava.lang.IllegalStateException: Prefix qri has not been declared
. The difference could simply be that in development we have extra internal checking switched on.
Updated by Michael Kay over 2 years ago
Succeeds on SaxonJ.
On SaxonJ (running without the extra checks in RegularSequenceChecker
) it's producing output without the required namespace declaration. So the bug affects both SaxonCS and SaxonJ.
Updated by Vijay Bhushan over 2 years ago
I am using C# API, we are supplying input in InitialContextNode property and for output we implemented ResultDocumentResovler. As you mentioned it succeeded in SaxonJ, does it mean there is an issue in SaxonCS 11.3.0?
Updated by Michael Kay over 2 years ago
- Subject changed from SaxonCS 11.3.0 - Namespace missing for child nodes to SaxonCS 11.3.0 - Namespace missing for elements copied using copy-namespaces="no"
- Category set to XSLT conformance
- Assignee set to Michael Kay
- Priority changed from Low to Normal
I think the problem is with TinyTextualElement.copy()
. The class TinyTextualElement
is used for an element in a TinyTree that has no attributes, no namespace declarations, and single text node child: here <qri:QuoteRef>NEG000001KWU</qri:QuoteRef>
. When this is copied with copy-namespaces="no"
, it's failing to pass on the namespace declaration for the element's name. The namespace declaration is output correctly for the qri:CustomerSpecificFields
element, which isn't represented as a TinyTextualElement
.
Updated by Vijay Bhushan over 2 years ago
Could you please let me know when can I expect this fix.
Updated by Michael Kay over 2 years ago
- Status changed from New to Resolved
- Applies to branch trunk added
- Fix Committed on Branch trunk added
- Platforms Java added
Patch committed.
Test case copy-5201 added to XSLT3 test suite.
The fix will be in the next maintenance release (which will be very soon).
Updated by Debbie Lockett over 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.4 added
- Fixed in Maintenance Release deleted (
11.3)
Bug fix applied in the Saxon 11.4 maintenance release.
Updated by Michael Kay about 2 years ago
- Status changed from Closed to Resolved
- Applies to branch 10 added
- Fix Committed on Branch 10 added
I have retrofitted the patch to the 10.x branch.
Updated by O'Neil Delpratt almost 2 years ago
- Fixed in Maintenance Release 12.0 added
Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied on the Saxon 10 branch.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 10.9 added
Bug fix applied in the Saxon 10.9 maintenance release.
Please register to edit this issue