Project

Profile

Help

Bug #5616

closed

SaxonCS 11.3.0 - Namespace missing for elements copied using copy-namespaces="no"

Added by Vijay Bhushan over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2022-07-27
Due date:
% Done:

100%

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

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

ExtractRequest_v1.xslt (790 Bytes) ExtractRequest_v1.xslt Vijay Bhushan, 2022-07-27 07:57
QuoteRetrievalRequest_SoapWrapper.xml (752 Bytes) QuoteRetrievalRequest_SoapWrapper.xml Vijay Bhushan, 2022-07-27 07:57
Saxon9he Output.xml (361 Bytes) Saxon9he Output.xml Vijay Bhushan, 2022-07-27 07:57
SaxonCS 11.3.0 Output.xml (315 Bytes) SaxonCS 11.3.0 Output.xml Vijay Bhushan, 2022-07-27 07:57
Actions #1

Updated by Michael Kay over 1 year 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.

Actions #2

Updated by Michael Kay over 1 year 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.

Actions #3

Updated by Vijay Bhushan over 1 year 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?

Actions #4

Updated by Michael Kay over 1 year 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.

Actions #5

Updated by Vijay Bhushan over 1 year ago

Could you please let me know when can I expect this fix.

Actions #6

Updated by Michael Kay over 1 year 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).

Actions #7

Updated by Debbie Lockett over 1 year 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.

Actions #8

Updated by Michael Kay over 1 year 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.

Actions #9

Updated by O'Neil Delpratt over 1 year 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.

Actions #10

Updated by O'Neil Delpratt about 1 year 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

Also available in: Atom PDF