Package net.sf.saxon.om
Class SelectedElementsSpaceStrippingRule
- java.lang.Object
-
- net.sf.saxon.om.SelectedElementsSpaceStrippingRule
-
- All Implemented Interfaces:
SpaceStrippingRule
public class SelectedElementsSpaceStrippingRule extends java.lang.Object implements SpaceStrippingRule
A whitespace stripping rule that strips elected elements unless xml:space indicates that whitespace should be preserved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSelectedElementsSpaceStrippingRule.StripRuleTarget
-
Constructor Summary
Constructors Constructor Description SelectedElementsSpaceStrippingRule()Create the ruleset
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRule(NodeTest test, Stripper.StripRuleTarget action, StylesheetModule module, int lineNumber)Add a ruleRulegetRule(NodeName nodeName)Get the rule corresponding to a given element node, by finding the best pattern match.byteisSpacePreserving(NodeName fingerprint)Decide whether an element is in the set of white-space preserving element names
-
-
-
Method Detail
-
isSpacePreserving
public byte isSpacePreserving(NodeName fingerprint) throws XPathException
Decide whether an element is in the set of white-space preserving element names- Specified by:
isSpacePreservingin interfaceSpaceStrippingRule- Parameters:
fingerprint- Identifies the name of the element whose whitespace is to be preserved- Returns:
- ALWAYS_PRESERVE if the element is in the set of white-space preserving element types, ALWAYS_STRIP if the element is to be stripped regardless of the xml:space setting, and STRIP_DEFAULT otherwise
- Throws:
XPathException- if the rules are ambiguous and ambiguities are to be reported as errors
-
addRule
public void addRule(NodeTest test, Stripper.StripRuleTarget action, StylesheetModule module, int lineNumber)
Add a rule- Parameters:
test- a NodeTest (*, *:local, prefix:*, or QName)action- StripRuleTarget.STRIP or StripRuleTarget.PRESERVEmodule- the stylesheet module containing the rule
-
-