Bug #5047
closedWhitespace stripping in DocumentBuilder ignores xml:space
100%
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.
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.
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.
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