Project

Profile

Help

Bug #4563

closed

Reuse of Xslt30Transformer causes wrong results (namespace)

Added by Stefan Fritz over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
s9api API
Sprint/Milestone:
-
Start date:
2020-05-28
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.8
Fix Committed on Branch:
10, 9.9
Fixed in Maintenance Release:
Platforms:

Description

Saxon EE 9.8.0.15

If Xslt30Transformer is reused it seems the result of the XSL output changes.

Let me go into more detail: We see this issue with different XSLs but picked one for the reproducible. The XSL removes the namespace from all but the root node.

We have two different input XMLs. The second with namespaces XML1. One without any namespace XML2.

If the Transformer processes the XML2 first and then XML1. The result will be without ANY namespace. It should keep the namespace on root node.

If the Transformer processes the XML1 first and then XML2 and then XML1 again. The result of the first and last transformation will be WITH a namespace on the root node.

Customer uses Java 7 but I reproduced it with Java 8.

This is blocking the customer upgrade project.

Attached is a reproducible. Simply run test01632275.java. The result on stdout is the XML output of the XSL. Line 57 is where you can change which XML to run first.


			// will cause all output be without any namespace --> WRONG
			// if(i==0) {

			// will cause all output 1 and 3 to be with namespace on root node --> CORRECT
			// if(i==1) {

			if (i == 0) {
				xml = xml2;
			} else {
				xml = xml1;
			}

Files

reproducible.zip (1.06 MB) reproducible.zip Stefan Fritz, 2020-05-28 16:17

Please register to edit this issue

Also available in: Atom PDF