com.novell.xsl
Class SAXtoDOMStrip

java.lang.Object
  extended bycom.novell.xml.sax.SAXtoDOM
      extended bycom.novell.xsl.SAXtoDOMStrip
All Implemented Interfaces:
DocumentCommentHandler, DocumentHandler, DTDHandler

public class SAXtoDOMStrip
extends SAXtoDOM

Class to process SAX events and turn them into a DOM tree, while performing XSLT source-document whitespace stripping


Field Summary
protected  Node currentText
           
protected  Stack stack
           
protected  StripList stripList
           
protected  boolean xmlSpacePreserve
           
 
Fields inherited from class com.novell.xml.sax.SAXtoDOM
currentNode, currentNodePosition, document, level2DOM, locator, namespaceStack, novellDOM
 
Constructor Summary
SAXtoDOMStrip(Document document, StripList stripList)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character data.
 void comment(String data)
          Handle a comment
 void endDocument()
          Receive notification of the end of a document.
 void endElement(String name)
          Receive notification of the end of an element.
protected  void popState()
          Restore state from a previous pushState()
 void processingInstruction(String target, String data)
          Receive notification of a processing instruction.
protected  void pushState()
          Push state that potentially changes with each Element
 void startElement(String name, AttributeList atts)
          Receive notification of the beginning of an element.
protected  void strip()
          Postentially strip the last text node according to the XSLT source tree whitespace stripping rules
 boolean stripNode(Node node)
          Return if a text or cdata section node should be stripped (not returned from an axis).
 
Methods inherited from class com.novell.xml.sax.SAXtoDOM
ensureDocType, getResult, ignorableWhitespace, notationDecl, setDocumentLocator, setLocatorInfo, startDocument, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentText

protected Node currentText

stripList

protected final StripList stripList

xmlSpacePreserve

protected boolean xmlSpacePreserve

stack

protected Stack stack
Constructor Detail

SAXtoDOMStrip

public SAXtoDOMStrip(Document document,
                     StripList stripList)
Method Detail

endDocument

public void endDocument()
                 throws SAXException
Receive notification of the end of a document.

Specified by:
endDocument in interface DocumentHandler
Overrides:
endDocument in class SAXtoDOM
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

startElement

public void startElement(String name,
                         AttributeList atts)
                  throws SAXException
Receive notification of the beginning of an element.

Specified by:
startElement in interface DocumentHandler
Overrides:
startElement in class SAXtoDOM
Parameters:
name - The element type name.
atts - The attributes attached to the element, if any.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
endElement(java.lang.String), AttributeList

endElement

public void endElement(String name)
                throws SAXException
Receive notification of the end of an element.

Specified by:
endElement in interface DocumentHandler
Overrides:
endElement in class SAXtoDOM
Parameters:
name - The element type name
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Receive notification of character data.

Specified by:
characters in interface DocumentHandler
Overrides:
characters in class SAXtoDOM
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
SAXtoDOM.ignorableWhitespace(char[], int, int), Locator

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Receive notification of a processing instruction.

Specified by:
processingInstruction in interface DocumentHandler
Overrides:
processingInstruction in class SAXtoDOM
Parameters:
target - The processing instruction target.
data - The processing instruction data, or null if none was supplied.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

comment

public void comment(String data)
             throws SAXException
Handle a comment

Specified by:
comment in interface DocumentCommentHandler
Overrides:
comment in class SAXtoDOM
Parameters:
data - The comment data, that is, everything between the tags.
Throws:
SAXException

strip

protected void strip()
Postentially strip the last text node according to the XSLT source tree whitespace stripping rules


stripNode

public boolean stripNode(Node node)
Return if a text or cdata section node should be stripped (not returned from an axis).

Parameters:
node - The text or cdata section node to test
Returns:
True if the node should be stripped, false otherwise

pushState

protected void pushState()
Push state that potentially changes with each Element


popState

protected void popState()
Restore state from a previous pushState()