net.sf.saxon.style

Class StylesheetStripper

Implemented Interfaces:
Receiver, Result

public class StylesheetStripper
extends Stripper

The StylesheetStripper refines the Stripper class to do stripping of whitespace nodes on a stylesheet. This is handled specially (a) because it is done at compile time, so there is no Controller available, and (b) because the rules are very simple
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

Method Summary

Stripper
getAnother()
Get a clean copy of this stripper
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
setStylesheetRules(NamePool namePool)
Set the rules appropriate for whitespace-stripping in a stylesheet

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

Method Details

getAnother

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

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

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.
Overrides:
isSpacePreserving in interface Stripper
Parameters:
element - Identifies the element whose whitespace is possibly to be preserved
Returns:
true if the element is in the set of white-space preserving element types

setStylesheetRules

public void setStylesheetRules(NamePool namePool)
Set the rules appropriate for whitespace-stripping in a stylesheet