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:
javax.xml.transform.Result
- Direct Known Subclasses:
StylesheetStripper
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
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Callback interface for SAX: not for application usevoidendElement(int nameCode)Callback interface for SAX: not for application usebooleangetPreserveAll()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 typesvoidsetController(Controller controller)Set the Controller to be usedvoidsetPreserveAll()Specify that all whitespace nodes are to be preservedvoidsetStripAll()Specify that all whitespace nodes are to be strippedvoidstartDocument()Callback interface for SAX: not for application usevoidstartElement(int nameCode, org.xml.sax.Attributes atts, int[] namespaces, int nscount)Callback interface for SAX: not for application use-
Methods 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 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
-
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
public void setController(Controller controller)
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
public void startDocument() throws javax.xml.transform.TransformerExceptionCallback interface for SAX: not for application use- Overrides:
startDocumentin classProxyEmitter- Throws:
javax.xml.transform.TransformerException
-
startElement
public void startElement(int nameCode, org.xml.sax.Attributes atts, int[] namespaces, int nscount) throws javax.xml.transform.TransformerExceptionCallback interface for SAX: not for application use- Overrides:
startElementin classProxyEmitternamespaces- Array of namespace codes identifying the namespace prefix/uri pairs associated with this elementnscount- Number of significant entries within namespaces array- Throws:
javax.xml.transform.TransformerException
-
endElement
public void endElement(int nameCode) throws javax.xml.transform.TransformerExceptionCallback interface for SAX: not for application use- Overrides:
endElementin classProxyEmitter- Throws:
javax.xml.transform.TransformerException
-
characters
public void characters(char[] ch, int start, int length) throws javax.xml.transform.TransformerExceptionCallback interface for SAX: not for application use- Overrides:
charactersin classProxyEmitter- Throws:
javax.xml.transform.TransformerException
-
-