net.sf.saxon.om

Class AllElementStripper

Implemented Interfaces:
Receiver, Result

public class AllElementStripper
extends Stripper

The AllElementStripper refines the Stripper class to do stripping of all whitespace nodes in a document
Author:
Michael H. Kay

Field Summary

Fields inherited from class net.sf.saxon.event.Stripper

ALWAYS_PRESERVE, ALWAYS_STRIP, CANNOT_STRIP, PRESERVE_PARENT, STRIP_DEFAULT

Fields inherited from class net.sf.saxon.event.ProxyReceiver

nextReceiver

Fields inherited from class net.sf.saxon.event.SequenceReceiver

pipelineConfiguration, previousAtomic, systemId

Constructor Summary

AllElementStripper()
Default constructor for use in subclasses

Method Summary

Stripper
getAnother()
Get a clean copy of this stripper
static AllElementStripper
getInstance()
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.

Methods inherited from class net.sf.saxon.event.Stripper

attribute, characters, endElement, getAnother, getStripAll, isSpacePreserving, isSpacePreserving, open, setPipelineConfiguration, setStripAll, setXPathContext, startElement

Methods inherited from class net.sf.saxon.event.ProxyReceiver

append, attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElement

Methods inherited from class net.sf.saxon.event.SequenceReceiver

append, getConfiguration, getNamePool, getPipelineConfiguration, getSystemId, open, setPipelineConfiguration, setSystemId, setUnparsedEntity

Constructor Details

AllElementStripper

public AllElementStripper()
Default constructor for use in subclasses

Method Details

getAnother

public Stripper getAnother()
Get a clean copy of this stripper
Overrides:
getAnother in interface Stripper

getInstance

public static AllElementStripper getInstance()

isSpacePreserving

public byte isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types
Overrides:
isSpacePreserving in interface Stripper
Parameters:
nameCode - identifies the element being tested
Returns:
STRIP_DEFAULT: strip spaces unless xml:space tells you not to.

isSpacePreserving

public byte isSpacePreserving(NodeInfo element)
Decide whether an element is in the set of white-space preserving element types. This version of the method is useful in cases where getting the namecode of the element is potentially expensive, e.g. with DOM nodes.
Overrides:
isSpacePreserving in interface Stripper
Parameters:
element - Identifies the element whose whitespace is possibly to be preserved