Bug #1534
closedSetting omit-xml-declaration in a Saxon s9api pipeline does not produce a result with no xml declaration
100%
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
Updated by Michael Kay over 12 years ago
- Category set to Serialization
- Status changed from New to In Progress
- Assignee changed from Andrea Bagnacani to O'Neil Delpratt
Updated by O'Neil Delpratt over 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.
Updated by Michael Kay over 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)
Updated by Michael Kay over 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.
Updated by Michael Kay over 12 years ago
- Found in version changed from 9.4 HE to 9.4
Updated by Michael Kay over 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