Project

Profile

Help

Bug #5047

closed

Whitespace stripping in DocumentBuilder ignores xml:space

Added by Michael Kay almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2021-07-24
Due date:
% Done:

100%

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

Description

During Saxon-CS development I created a new unit test TestDocumentBuilder.TestCustomWhitespacePolicyWithXmlSpace and found that it fails when retrofitted to Saxon 10. The test is designed to ensure that no whitespace stripping occurs for descendants of an element with @xml:space="preserve".

The Stripper class, which is implementing the whitespace stripping, is designed to take account of xml:space, but in this case it seems to ignore it. Note that this class is also used for standard XSLT-based whitespace stripping, so the bug could affect that too.

Actions #1

Updated by Michael Kay almost 3 years ago

The problem is specific to the API WhitespaceStrippingPolicy.makeCustomPolicy(), which supplies a predicate used to decide whether whitespace should be stripped or preserved. There's nothing in the documentation of this API that says whether xml:space is honoured or not, and it turns out that it isn't. So I think I'll just document the current behaviour.

Actions #2

Updated by Michael Kay over 2 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 10, trunk added

Javadoc changed so the documentation matches the code.

Actions #3

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.6 added

Bug fix applied in the Saxon 10.6 maintenance release

Please register to edit this issue

Also available in: Atom PDF