Package com.icl.saxon.om
Class Stripper
java.lang.Object
com.icl.saxon.output.Emitter
com.icl.saxon.output.ProxyEmitter
com.icl.saxon.om.Stripper
- All Implemented Interfaces:
Result
- Direct Known Subclasses:
StylesheetStripper
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
-
Field Summary
Fields inherited from class com.icl.saxon.output.ProxyEmitter
baseEmitter, outputProperties
Fields inherited from class com.icl.saxon.output.Emitter
locator, outputStream, systemId, writer
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) Callback interface for SAX: not for application usevoid
endElement
(int nameCode) Callback interface for SAX: not for application useboolean
Determine if all whitespace is to be preserved (in this case, no further testing is needed)boolean
Determine if all whitespace is to be stripped (in this case, no further testing is needed)boolean
isSpacePreserving
(int nameCode) Decide whether an element is in the set of white-space preserving element typesvoid
setController
(Controller controller) Set the Controller to be usedvoid
Specify that all whitespace nodes are to be preservedvoid
Specify that all whitespace nodes are to be strippedvoid
Callback interface for SAX: not for application usevoid
startElement
(int nameCode, Attributes atts, int[] namespaces, int nscount) Callback interface for SAX: not for application useMethods inherited from class com.icl.saxon.output.ProxyEmitter
comment, endDocument, processingInstruction, setDocumentLocator, setEscaping, setNamePool, setOutputProperties, setUnderlyingEmitter, setUnparsedEntity, setWriter
Methods inherited from class com.icl.saxon.output.Emitter
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setOutputStream, setSystemId, usesWriter
-
Constructor Details
-
Stripper
protected Stripper()Default constructor for use in subclasses -
Stripper
create a Stripper and initialise variables- Parameters:
stripperRules
- : defines which elements have whitespace stripped. If null, all whitespace is preserved.
-
-
Method Details
-
setPreserveAll
public void setPreserveAll()Specify that all whitespace nodes are to be preserved -
getPreserveAll
public boolean getPreserveAll()Determine if all whitespace is to be preserved (in this case, no further testing is needed) -
setStripAll
public void setStripAll()Specify that all whitespace nodes are to be stripped -
getStripAll
public boolean getStripAll()Determine if all whitespace is to be stripped (in this case, no further testing is needed) -
setController
Set the Controller to be used -
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 namelocalname
- The local part of the element name- Returns:
- true if the element is in the set of white-space preserving element types
-
startDocument
Callback interface for SAX: not for application use- Overrides:
startDocument
in classProxyEmitter
- Throws:
TransformerException
-
startElement
public void startElement(int nameCode, Attributes atts, int[] namespaces, int nscount) throws TransformerException Callback interface for SAX: not for application use- Overrides:
startElement
in classProxyEmitter
- Parameters:
namespaces
- Array of namespace codes identifying the namespace prefix/uri pairs associated with this elementnscount
- Number of significant entries within namespaces array- Throws:
TransformerException
-
endElement
Callback interface for SAX: not for application use- Overrides:
endElement
in classProxyEmitter
- Throws:
TransformerException
-
characters
Callback interface for SAX: not for application use- Overrides:
characters
in classProxyEmitter
- Throws:
TransformerException
-