Project

Profile

Help

Bug #5859

closed

Handling of undeclared namespaces in a programmatically constructed DOM

Added by Nathan Claeys about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DOM Interface
Sprint/Milestone:
-
Start date:
2023-01-26
Due date:
% Done:

100%

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

Description

Summary

Saxon crashes if the input is a DOM tree containing namespaced ("DOM level 2") elements or attributes without corresponding namespace declaration attributes.

Problem Report

The java net.sf.saxon.jaxp.TransformerImpl class has the method transform(Source xmlSource, final Result outputTarget).

Since version 10 in Saxon HE, it no longer properly copies over qualified namespaces from elements that are copied with xslt:copy-of. This is also broken in Saxon HE 11.4.

It seems to work fine with the DomResult type, but using a StreamResult does not return the namespaces of the copied elements. The result is an undeclared namespace error. I have included a test project which works fine with Saxon HE 9.9.1-8, any later version does not copy the required namespaces.


Files

testing-namespaces.zip (7.95 KB) testing-namespaces.zip test project Nathan Claeys, 2023-01-26 17:08

Please register to edit this issue

Also available in: Atom PDF