Project

Profile

Help

Bug #3894

closed

Output properties item-separator and saxon:newline should not be whitespace-stripped

Added by Michael Kay over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Serialization
Sprint/Milestone:
-
Start date:
2018-09-04
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

Saxon is performing whitespace stripping on all serialization parameters supplied to xsl:output or xsl:result-document.

The is not appropriate for all parameters, in particular item-separator and saxon:newline.

The method ResultDocument.setSerializationProperty() refrains from doing space-stripping in the case of item-separator (but not saxon:newline), but in the case of parameters supplied to xsl:output and xsl:result-document the damage has already been done by then.

It's possible to get values containing spaces through from the command line (!saxon:newline=" ") though I haven't found a way to get newlines and carriage returns through this interface - no doubt it depends on the shell interpreter in use. Presumably this means it's also possible via the Java API.

Actions #1

Updated by Michael Kay over 5 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.8, trunk added
  • Fix Committed on Branch 9.8, trunk added

I have added some test cases to the XSLT 3.0 output and result-document test sets setting item-separator to various whitespace values. Note that these generally need to be written using character entities because of XML attribute value normalization.

I have added new test cases to the XSLT 3.0 Extra test suite output-properties for saxon:newline.

I have changed XSLOutput and XSLResultDocument to avoid trimming whitespace on item-separator and saxon:newline. With these changes the tests pass on the 9.9 branch. The item-separator property on the 9.8 branch is something of a lost cause, but I will make the same changes anyway, even though the tests fail for other reasons. Note that whitespace in a property computed as an AVT in xsl;result-document gets through without requiring these changes.

I have also changed ResultDocument.setSerializationProperty() to refrain from whitespace-stripping saxon:newline (there was already special-case code for item-separator in this case).

Actions #2

Updated by O'Neil Delpratt over 5 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.0.1 added

Bug fix applied in the Saxon 9.9.0.1 major release.

Leave open until fix applied in the next Saxon 9.8 maintenance release.

Actions #3

Updated by O'Neil Delpratt over 5 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.8.0.15 added

Bug fix applied in the Saxon 9.8.0.15 maintenance release.

Please register to edit this issue

Also available in: Atom PDF