|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.icl.saxon.tree.Stripper
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. It also includes a free-standing method to strip an existing tree.
Constructor Summary | |
Stripper()
create a Stripper and initialise variables |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Callback interface for SAX: not for application use |
void |
comment(char[] ch,
int start,
int length)
Callback interface for SAX (part of LexicalHandler interface): not for application use |
void |
endCDATA()
|
void |
endDocument()
Callback interface for SAX: not for application use |
void |
endDTD()
|
void |
endElement(java.lang.String uri,
java.lang.String localname,
java.lang.String rawname)
Callback interface for SAX: not for application use |
void |
endEntity(java.lang.String name)
|
void |
endPrefixMapping(java.lang.String prefix)
Callback interface for SAX: not for application use |
void |
flush()
Flush buffer for accumulated character data, suppressing white space if appropriate |
boolean |
getPreserveAll()
Return true if all whitespace nodes are to be preserved |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Callback interface for SAX: not for application use |
boolean |
isSpacePreserving(java.lang.String uri,
java.lang.String localname)
Decide whether an element is in the set of white-space preserving element types |
void |
processingInstruction(java.lang.String name,
java.lang.String remainder)
Callback interface for SAX: not for application use |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Callback interface for SAX: not for application use |
void |
setNextHandler(org.xml.sax.ContentHandler handler)
|
void |
setPreserveSpace(AnyNameTest any,
boolean preserve)
|
void |
setPreserveSpace(Name name,
boolean preserve)
Add an element to the list of elements for which white space is preserved / stripped. |
void |
setPreserveSpace(PrefixTest test,
boolean preserve)
|
void |
skippedEntity(java.lang.String name)
|
void |
startCDATA()
|
void |
startDocument()
Callback interface for SAX: not for application use |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
startElement(java.lang.String uri,
java.lang.String localname,
java.lang.String rawname,
org.xml.sax.Attributes atts)
Callback interface for SAX: not for application use |
void |
startEntity(java.lang.String name)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Callback interface for SAX: not for application use |
void |
strip(DocumentInfo doc)
Prune the tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Stripper()
Method Detail |
public void setPreserveSpace(Name name, boolean preserve)
name
- The element namepreserve
- true: preserve space for this element;public void setPreserveSpace(PrefixTest test, boolean preserve)
public void setPreserveSpace(AnyNameTest any, boolean preserve)
public boolean isSpacePreserving(java.lang.String uri, java.lang.String localname)
uri
- The namespace URI of the element namelocalname
- The local part of the element namepublic boolean getPreserveAll()
public void setNextHandler(org.xml.sax.ContentHandler handler)
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in interface org.xml.sax.ContentHandler
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
endPrefixMapping
in interface org.xml.sax.ContentHandler
public void startElement(java.lang.String uri, java.lang.String localname, java.lang.String rawname, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
public void endElement(java.lang.String uri, java.lang.String localname, java.lang.String rawname) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in interface org.xml.sax.ContentHandler
public void processingInstruction(java.lang.String name, java.lang.String remainder) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
comment
in interface org.xml.sax.ext.LexicalHandler
public void flush() throws org.xml.sax.SAXException
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
startDTD
in interface org.xml.sax.ext.LexicalHandler
public void endDTD() throws org.xml.sax.SAXException
endDTD
in interface org.xml.sax.ext.LexicalHandler
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
startEntity
in interface org.xml.sax.ext.LexicalHandler
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
endEntity
in interface org.xml.sax.ext.LexicalHandler
public void startCDATA() throws org.xml.sax.SAXException
startCDATA
in interface org.xml.sax.ext.LexicalHandler
public void endCDATA() throws org.xml.sax.SAXException
endCDATA
in interface org.xml.sax.ext.LexicalHandler
public void strip(DocumentInfo doc) throws org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |