org.apache.xalan.xsltc.trax

Class SAX2DOM

Implemented Interfaces:
Constants, ContentHandler, LexicalHandler

public class SAX2DOM
extends java.lang.Object
implements ContentHandler, LexicalHandler, Constants

Author:
G. Todd Miller

Fields inherited from interface org.apache.xalan.xsltc.runtime.Constants

ANY, ATTRIBUTE, COMMENT, ELEMENT, EMPTYSTRING, NAMESPACE_FEATURE, PROCESSING_INSTRUCTION, ROOT, TEXT, XMLNS_PREFIX, XMLNS_STRING, XMLNS_URI, XML_PREFIX, XSLT_URI

Constructor Summary

SAX2DOM()
SAX2DOM(Node root)

Method Summary

void
characters(char[] ch, int start, int length)
void
comment(char[] ch, int start, int length)
Lexical Handler method to create comment node in DOM tree.
void
endCDATA()
Report the end of a CDATA section.
void
endDTD()
Report the end of DTD declarations.
void
endDocument()
void
endElement(String namespace, String localName, String qName)
void
endEntity(String name)
Report the end of an entity.
void
endPrefixMapping(String prefix)
Node
getDOM()
void
ignorableWhitespace(char[] ch, int start, int length)
This class is only used internally so this method should never be called.
void
processingInstruction(String target, String data)
adds processing instruction node to DOM.
void
setDocumentLocator(Locator locator)
This class is only used internally so this method should never be called.
void
skippedEntity(String name)
This class is only used internally so this method should never be called.
void
startCDATA()
Report the start of a CDATA section.
void
startDTD(String name, String publicId, String systemId)
Report the start of DTD declarations, if any.
void
startDocument()
void
startElement(String namespace, String localName, String qName, Attributes attrs)
void
startEntity(java.lang.String name)
void
startPrefixMapping(String prefix, String uri)

Constructor Details

SAX2DOM

public SAX2DOM()
            throws ParserConfigurationException


SAX2DOM

public SAX2DOM(Node root)
            throws ParserConfigurationException

Method Details

characters

public void characters(char[] ch,
                       int start,
                       int length)


comment

public void comment(char[] ch,
                    int start,
                    int length)
Lexical Handler method to create comment node in DOM tree.


endCDATA

public void endCDATA()
Report the end of a CDATA section.
Specified by:
endCDATA in interface LexicalHandler

See Also:
LexicalHandler.startCDATA()


endDTD

public void endDTD()
Report the end of DTD declarations.

This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

Specified by:
endDTD in interface LexicalHandler

See Also:
LexicalHandler.startDTD(String,String,String)


endDocument

public void endDocument()
Specified by:
endDocument in interface ContentHandler


endElement

public void endElement(String namespace,
                       String localName,
                       String qName)
Specified by:
endElement in interface ContentHandler


endEntity

public void endEntity(String name)
Report the end of an entity.
Specified by:
endEntity in interface LexicalHandler

Parameters:
name - The name of the entity that is ending.

See Also:
LexicalHandler.startEntity(String)


endPrefixMapping

public void endPrefixMapping(String prefix)
Specified by:
endPrefixMapping in interface ContentHandler


getDOM

public Node getDOM()


ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
This class is only used internally so this method should never be called.


processingInstruction

public void processingInstruction(String target,
                                  String data)
adds processing instruction node to DOM.
Specified by:
processingInstruction in interface ContentHandler


setDocumentLocator

public void setDocumentLocator(Locator locator)
This class is only used internally so this method should never be called.
Specified by:
setDocumentLocator in interface ContentHandler


skippedEntity

public void skippedEntity(String name)
This class is only used internally so this method should never be called.
Specified by:
skippedEntity in interface ContentHandler


startCDATA

public void startCDATA()
Specified by:
startCDATA in interface LexicalHandler

See Also:
LexicalHandler.endCDATA()


startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
            throws SAXException
Report the start of DTD declarations, if any.

This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

All declarations reported through DTDHandler or DeclHandler events must appear between the startDTD and endDTD events. Declarations are assumed to belong to the internal DTD subset unless they appear between startEntity and endEntity events. Comments and processing instructions from the DTD should also be reported between the startDTD and endDTD events, in their original order of (logical) occurrence; they are not required to appear in their correct locations relative to DTDHandler or DeclHandler events, however.

Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event.

Specified by:
startDTD in interface LexicalHandler

Parameters:
name - The document type name.
publicId - The declared public identifier for the external DTD subset, or null if none was declared.
systemId - The declared system identifier for the external DTD subset, or null if none was declared. (Note that this is not resolved against the document base URI.)

Throws:
SAXException - The application may raise an exception.

See Also:
LexicalHandler.endDTD(), LexicalHandler.startEntity(String)


startDocument

public void startDocument()
Specified by:
startDocument in interface ContentHandler


startElement

public void startElement(String namespace,
                         String localName,
                         String qName,
                         Attributes attrs)
Specified by:
startElement in interface ContentHandler


startEntity

public void startEntity(java.lang.String name)


startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
Specified by:
startPrefixMapping in interface ContentHandler


Copyright B) 2004 Apache XML Project. All Rights Reserved.