org.apache.xalan.stree
Class StreeDOMBuilder

java.lang.Object
  |
  +--org.apache.xml.utils.DOMBuilder
        |
        +--org.apache.xalan.stree.StreeDOMBuilder

public class StreeDOMBuilder
extends DOMBuilder

**For internal use only** This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and adds the result to a document or document fragment.


Fields inherited from class org.apache.xml.utils.DOMBuilder
m_doc, m_docFrag
 
Constructor Summary
StreeDOMBuilder(Document doc)
          StreeDOMBuilder instance constructor...
StreeDOMBuilder(Document doc, DocumentFragment docFrag)
          StreeDOMBuilder instance constructor...
StreeDOMBuilder(Document doc, Node node)
          StreeDOMBuilder instance constructor...
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character data.
 void charactersRaw(char[] ch, int start, int length)
          If available, when the disable-output-escaping attribute is used, output raw text without escaping.
 void comment(char[] ch, int start, int length)
          Report an XML comment anywhere in the document.
 void endDocument()
          Receive notification of the end of a document.
 void endElement(java.lang.String ns, java.lang.String localName, java.lang.String name)
          Receive notification of the end of an element.
 void ignorableWhitespace(char[] ch, int start, int length)
          Receive notification of ignorable whitespace in element content.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Receive notification of ignorable whitespace in element content.
 void setIDAttribute(java.lang.String id, Element elem)
          Set an ID string to node association in the ID table.
 void setPreviousIsText(boolean isText)
          Set the state of the source tree to indicate whether the last event was a characters event.
 void startElement(java.lang.String ns, java.lang.String localName, java.lang.String name, Attributes atts)
          Receive notification of the beginning of an element.
 
Methods inherited from class org.apache.xml.utils.DOMBuilder
cdata, endCDATA, endDTD, endEntity, endPrefixMapping, entityReference, getCurrentNode, getRootNode, getWriter, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreeDOMBuilder

public StreeDOMBuilder(Document doc,
                       Node node)
StreeDOMBuilder instance constructor... it will add the DOM nodes to the document fragment.
Parameters:
doc - Root node of DOM being created
node - Node currently being processed

StreeDOMBuilder

public StreeDOMBuilder(Document doc,
                       DocumentFragment docFrag)
StreeDOMBuilder instance constructor... it will add the DOM nodes to the document fragment.
Parameters:
doc - Root node of DOM being created
docFrag - Document fragment node of DOM being created

StreeDOMBuilder

public StreeDOMBuilder(Document doc)
StreeDOMBuilder instance constructor... it will add the DOM nodes to the document.
Parameters:
doc - Root node of DOM being created
Method Detail

setIDAttribute

public void setIDAttribute(java.lang.String id,
                           Element elem)
Set an ID string to node association in the ID table.
Parameters:
id - The ID string.
elem - The associated ID.
Overrides:
setIDAttribute in class DOMBuilder

startElement

public void startElement(java.lang.String ns,
                         java.lang.String localName,
                         java.lang.String name,
                         Attributes atts)
                  throws SAXException
Receive notification of the beginning of an element.
Parameters:
ns - namespace URL of the element
localName - local part of qualified name of the element
name - The element type name.
atts - The attributes attached to the element, if any.
Throws:
SAXException -  
Overrides:
startElement in class DOMBuilder
See Also:
DOMBuilder.startElement(String, String, String, Attributes)

endElement

public void endElement(java.lang.String ns,
                       java.lang.String localName,
                       java.lang.String name)
                throws SAXException
Receive notification of the end of an element.
Parameters:
ns - namespace URL of the element
localName - local part of qualified name of the element
name - The element type name
Throws:
SAXException -  
Overrides:
endElement in class DOMBuilder

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Receive notification of character data.
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 -  
SAXException -  
Overrides:
characters in class DOMBuilder

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Receive notification of ignorable whitespace in element content.
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 -  
SAXException -  
Overrides:
ignorableWhitespace in class DOMBuilder

charactersRaw

public void charactersRaw(char[] ch,
                          int start,
                          int length)
                   throws SAXException
If available, when the disable-output-escaping attribute is used, output raw text without escaping. A PI will be inserted in front of the node with the name "lotusxsl-next-is-raw" and a value of "formatter-to-dom".
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 -  
SAXException -  
Overrides:
charactersRaw in class DOMBuilder

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Report an XML comment anywhere in the document.
Parameters:
ch - An array holding the characters in the comment.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
SAXException -  
SAXException -  
Overrides:
comment in class DOMBuilder

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws SAXException
Receive notification of ignorable whitespace in element content.
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.
Overrides:
processingInstruction in class DOMBuilder
See Also:
characters(char[], int, int)

setPreviousIsText

public void setPreviousIsText(boolean isText)
                       throws SAXException
Set the state of the source tree to indicate whether the last event was a characters event.
Parameters:
isText - True if last event was a characters event
Throws:
SAXException -  

endDocument

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

The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.

Overrides:
endDocument in class DOMBuilder


Copyright � 2000 Apache XML Project. All Rights Reserved.