Saxon.Api
Class WhitespacePolicy
-
public class WhitespacePolicy
WhitespacePolicy
is a class defining the possible policies for handling
whitespace text nodes in a source document.
Please note that since Saxon 9.7.0.8 this class has been refactored from the enumeration type with the same name and therefore will work as before.
Field Summary |
|
---|---|
static WhitespacePolicy | PreserveAll No whitespace is stripped |
static WhitespacePolicy | StripAll All whitespace text nodes are stripped |
static WhitespacePolicy | StripIgnorable Whitespace text nodes appearing in element-only content are stripped |
static WhitespacePolicy | Unspecified Unspecified means that no other value has been specifically requested |
Method Summary |
|
---|---|
static WhitespacePolicy | makeCustomPolicy(Predicate<QName> elementTest) Create a custom whitespace stripping policy |
Field Detail
StripIgnorable
Whitespace text nodes appearing in element-only content are stripped
Unspecified
Unspecified means that no other value has been specifically requested
Method Detail
makeCustomPolicy
Create a custom whitespace stripping policy
Parameters:
elementTest
- a predicate applied to element names, which should return true if whitespace-only text node children of the element are to be stripped, false if they are to be retained.Returns:
WhitespacePolicy
object