net.sf.saxon.event
Class Stripper
- Receiver, Result
The Stripper class maintains details of which elements need to be stripped.
The code is written to act as a SAX-like filter to do the stripping.
Stripper() - Default constructor for use in subclasses
|
Stripper(Mode stripperRules) - create a Stripper and initialise variables
|
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)
|
append , attribute , characters , close , comment , endDocument , endElement , getConfiguration , getDocumentLocator , getNamePool , getUnderlyingReceiver , namespace , open , processingInstruction , setPipelineConfiguration , setSystemId , setUnderlyingReceiver , setUnparsedEntity , startContent , startDocument , startElement |
ALWAYS_PRESERVE
public static final byte ALWAYS_PRESERVE
ALWAYS_STRIP
public static final byte ALWAYS_STRIP
CANNOT_STRIP
public static final byte CANNOT_STRIP
PRESERVE_PARENT
public static final byte PRESERVE_PARENT
STRIP_DEFAULT
public static final byte STRIP_DEFAULT
Stripper
protected Stripper()
Default constructor for use in subclasses
Stripper
public Stripper(Mode stripperRules)
create a Stripper and initialise variables
stripperRules
- defines which elements have whitespace stripped. If
null, all whitespace is preserved.
getAnother
public Stripper getAnother()
Get a clean copy of this stripper
getStripAll
public boolean getStripAll()
Determine if all whitespace is to be stripped (in this case, no further testing
is needed)
isSpacePreserving
public byte isSpacePreserving(int nameCode)
throws XPathException
Decide whether an element is in the set of white-space preserving element types
nameCode
- Identifies the name of the element whose whitespace is to
be preserved
- 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
isSpacePreserving
public byte isSpacePreserving(NodeInfo element)
throws XPathException
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.
element
- Identifies the element whose whitespace is possibly to
be preserved
- 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
setStripAll
public void setStripAll()
Specify that all whitespace nodes are to be stripped
setXPathContext
public void setXPathContext(XPathContext context)
Set the XPath context