Project

Profile

Help

Bug #3631

closed

saxon:next-in-chain does not work with Saxon 9.8.0.7 if I try to get an output property before I run the transformation

Added by Octavian Nadolu over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2018-01-18
Due date:
% Done:

100%

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

Description

If I run the transformation with Saxon 9.8.0.7 using the code below, I get an exception:


The problem seems to be generated because I want to obtain the encoding from the transformer before I run the transformation.  If I remove the line that gets the encoding "transformer.getOutputProperty("encoding");", the transformation works

<pre><code class="java">
String sourceID = "test.xml"; 
String xslID = "main.xsl";

// Create a transform factory instance.
TransformerFactoryImpl tfactory = new ProfessionalTransformerFactory();

// Create a transformer for the stylesheet.
Transformer transformer = tfactory.newTransformer(new StreamSource(xslID));

// Obtain the encoding
*String transformerEncoding = transformer.getOutputProperty("encoding");*

// Transform the source XML to System.out.
transformer.transform(new StreamSource(sourceID), new StreamResult(System.out));

Files

main.xsl (457 Bytes) main.xsl Octavian Nadolu, 2018-01-18 11:14
second.xsl (362 Bytes) second.xsl Octavian Nadolu, 2018-01-18 11:14
test.xml (47 Bytes) test.xml Octavian Nadolu, 2018-01-18 11:14

Please register to edit this issue

Also available in: Atom PDF