com.icl.saxon.om

Class Stripper

public class Stripper extends ProxyEmitter

The Stripper class maintains details of which elements need to be stripped. The code is written to act as a SAX filter to do the stripping.

Author: Michael H. Kay

Constructor Summary
protected Stripper()
Default constructor for use in subclasses
Stripper(Mode stripperRules)
create a Stripper and initialise variables
Method Summary
voidcharacters(char[] ch, int start, int length)
Callback interface for SAX: not for application use
voidendElement(int nameCode)
Callback interface for SAX: not for application use
booleangetPreserveAll()
Determine if all whitespace is to be preserved (in this case, no further testing is needed)
booleangetStripAll()
Determine if all whitespace is to be stripped (in this case, no further testing is needed)
booleanisSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types
voidsetController(Controller controller)
Set the Controller to be used
voidsetPreserveAll()
Specify that all whitespace nodes are to be preserved
voidsetStripAll()
Specify that all whitespace nodes are to be stripped
voidstartDocument()
Callback interface for SAX: not for application use
voidstartElement(int nameCode, Attributes atts, int[] namespaces, int nscount)
Callback interface for SAX: not for application use

Constructor Detail

Stripper

protected Stripper()
Default constructor for use in subclasses

Stripper

public Stripper(Mode stripperRules)
create a Stripper and initialise variables

Parameters: stripperRules: defines which elements have whitespace stripped. If null, all whitespace is preserved.

Method Detail

characters

public void characters(char[] ch, int start, int length)
Callback interface for SAX: not for application use

endElement

public void endElement(int nameCode)
Callback interface for SAX: not for application use

getPreserveAll

public boolean getPreserveAll()
Determine if all whitespace is to be preserved (in this case, no further testing is needed)

getStripAll

public boolean getStripAll()
Determine if all whitespace is to be stripped (in this case, no further testing is needed)

isSpacePreserving

public boolean isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types

Parameters: uri The namespace URI of the element name localname The local part of the element name

Returns: true if the element is in the set of white-space preserving element types

setController

public void setController(Controller controller)
Set the Controller to be used

setPreserveAll

public void setPreserveAll()
Specify that all whitespace nodes are to be preserved

setStripAll

public void setStripAll()
Specify that all whitespace nodes are to be stripped

startDocument

public void startDocument()
Callback interface for SAX: not for application use

startElement

public void startElement(int nameCode, Attributes atts, int[] namespaces, int nscount)
Callback interface for SAX: not for application use