Project

Profile

Help

Bug #1534

closed

Setting omit-xml-declaration in a Saxon s9api pipeline does not produce a result with no xml declaration

Added by Andrea Bagnacani almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Serialization
Sprint/Milestone:
-
Start date:
2012-05-15
Due date:
% Done:

100%

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

Description

Setting up a s9api pipeline consisting of two XsltTransformer objects followed by a Serializer: the second stylesheet sets omit-xml-declaration="no" but the result contains the unwanted xml declaration.

Use the files in attachment to reproduce the problem


Files

Pipeline.java (2.44 KB) Pipeline.java java source file to be compiled Andrea Bagnacani, 2012-05-15 13:27
echo_given_sourcefile.xsl (376 Bytes) echo_given_sourcefile.xsl first transformer's xsl stylesheet Andrea Bagnacani, 2012-05-15 13:27
print_elements.xsl (845 Bytes) print_elements.xsl second transformer's xsl stylesheet Andrea Bagnacani, 2012-05-15 13:27
Actions #1

Updated by Michael Kay almost 12 years ago

  • Category set to Serialization
  • Status changed from New to In Progress
  • Assignee changed from Andrea Bagnacani to O'Neil Delpratt
Actions #2

Updated by O'Neil Delpratt almost 12 years ago

  • Status changed from In Progress to Resolved

This is definitely a bug caused by the transform method bypassing the properties of the Serializer object from the second transformer.

Fix applied in the close method of the XsltTransformer class to combine the Serializer and transform properties. This will appear in the next 9.4 maintenance release.

Actions #3

Updated by Michael Kay almost 12 years ago

  • Subject changed from setting omit xml declaration in a saxon pipeline does not produce a result with no xml declaration to Setting omit-xml-declaration in a Saxon s9api pipeline does not produce a result with no xml declaration
  • Description updated (diff)
Actions #4

Updated by Michael Kay almost 12 years ago

A bit more detail of the bug, for the record. In s9api, when the destination of a XsltTransformer is specified as a Serializer, there is some logic to combine the serialization properties requesed in xsl:output declarations in the stylesheet with the properties requested programmatically using the Serializer API. This logic is not being executed in the case where the XsltTransformer is invoked as the destination of another transformation, as distinct from the case where it is invoked directly using the transform() method. The effect is that the serialization properties used are those from the Serializer object, not those from the stylesheet. A workaround is therefore to set the required properties programmatically on the Serializer object.

Actions #5

Updated by Michael Kay almost 12 years ago

  • Found in version changed from 9.4 HE to 9.4
Actions #6

Updated by Michael Kay almost 12 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.4.0.4

Please register to edit this issue

Also available in: Atom PDF