net.sf.saxon.event
public class Stripper extends ProxyReceiver
Field Summary | |
---|---|
static byte | ALWAYS_PRESERVE |
static byte | ALWAYS_STRIP |
static byte | CANNOT_STRIP |
static RuleTarget | PRESERVE |
static byte | PRESERVE_PARENT |
static RuleTarget | STRIP |
static byte | STRIP_DEFAULT |
Constructor Summary | |
---|---|
protected | Stripper()
Default constructor for use in subclasses |
Stripper(Mode stripperRules)
create a Stripper and initialise variables |
Method Summary | |
---|---|
void | attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) |
void | characters(CharSequence chars, int locationId, int properties)
Handle a text node |
void | endElement()
Handle an end-of-element event |
Stripper | getAnother()
Get a clean copy of this stripper |
boolean | getStripAll()
Determine if all whitespace is to be stripped (in this case, no further testing
is needed) |
byte | isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types |
byte | isSpacePreserving(NodeInfo element)
Decide whether an element is in the set of white-space preserving element types.
|
void | open()
Callback interface for SAX: not for application use |
void | setPipelineConfiguration(PipelineConfiguration pipe) |
void | setStripAll()
Specify that all whitespace nodes are to be stripped |
void | setXPathContext(XPathContext context)
Set the XPath context |
void | startElement(int nameCode, int typeCode, int locationId, int properties) |
boolean | usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events |
Parameters: stripperRules defines which elements have whitespace stripped. If null, all whitespace is preserved.
Parameters: nameCode 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
Parameters: element Identifies the element whose whitespace is possibly 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
Returns: true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation