org.apache.xalan.xsltc.trax
Class DOM2SAX

java.lang.Object
  extended by org.apache.xalan.xsltc.trax.DOM2SAX
All Implemented Interfaces:
org.xml.sax.Locator, org.xml.sax.XMLReader

public class DOM2SAX
extends java.lang.Object
implements org.xml.sax.XMLReader, org.xml.sax.Locator


Field Summary
private  org.w3c.dom.Node _dom
           
private  org.xml.sax.ext.LexicalHandler _lex
           
private  java.util.Hashtable _nsPrefixes
           
private  org.xml.sax.ContentHandler _sax
           
private  SAXImpl _saxImpl
           
private static java.lang.String EMPTYSTRING
           
private static java.lang.String XMLNS_PREFIX
           
 
Constructor Summary
DOM2SAX(org.w3c.dom.Node root)
           
 
Method Summary
private  void endPrefixMapping(java.lang.String prefix)
           
 int getColumnNumber()
          This class is only used internally so this method should never be called.
 org.xml.sax.ContentHandler getContentHandler()
           
 org.xml.sax.DTDHandler getDTDHandler()
          This class is only used internally so this method should never be called.
 org.xml.sax.EntityResolver getEntityResolver()
          This class is only used internally so this method should never be called.
 org.xml.sax.ErrorHandler getErrorHandler()
          This class is only used internally so this method should never be called.
 boolean getFeature(java.lang.String name)
          This class is only used internally so this method should never be called.
 int getLineNumber()
          This class is only used internally so this method should never be called.
private static java.lang.String getLocalName(org.w3c.dom.Node node)
          If the DOM was created using a DOM 1.0 API, the local name may be null.
private  java.lang.String getNodeTypeFromCode(short code)
           
 java.lang.Object getProperty(java.lang.String name)
          This class is only used internally so this method should never be called.
 java.lang.String getPublicId()
          This class is only used internally so this method should never be called.
 java.lang.String getSystemId()
          This class is only used internally so this method should never be called.
 void parse()
           
 void parse(org.xml.sax.InputSource unused)
           
private  void parse(org.w3c.dom.Node node)
          Traverse the DOM and generate SAX events for a handler.
 void parse(java.lang.String sysId)
          This class is only used internally so this method should never be called.
 void setContentHandler(org.xml.sax.ContentHandler handler)
           
 void setDTDHandler(org.xml.sax.DTDHandler handler)
          This class is only used internally so this method should never be called.
 void setEntityResolver(org.xml.sax.EntityResolver resolver)
          This class is only used internally so this method should never be called.
 void setErrorHandler(org.xml.sax.ErrorHandler handler)
          This class is only used internally so this method should never be called.
 void setFeature(java.lang.String name, boolean value)
          This class is only used internally so this method should never be called.
 void setProperty(java.lang.String name, java.lang.Object value)
          This class is only used internally so this method should never be called.
private  boolean startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Begin the scope of namespace prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTYSTRING

private static final java.lang.String EMPTYSTRING
See Also:
Constant Field Values

XMLNS_PREFIX

private static final java.lang.String XMLNS_PREFIX
See Also:
Constant Field Values

_dom

private org.w3c.dom.Node _dom

_sax

private org.xml.sax.ContentHandler _sax

_lex

private org.xml.sax.ext.LexicalHandler _lex

_saxImpl

private SAXImpl _saxImpl

_nsPrefixes

private java.util.Hashtable _nsPrefixes
Constructor Detail

DOM2SAX

public DOM2SAX(org.w3c.dom.Node root)
Method Detail

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Specified by:
getContentHandler in interface org.xml.sax.XMLReader

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler handler)
                       throws java.lang.NullPointerException
Specified by:
setContentHandler in interface org.xml.sax.XMLReader
Throws:
java.lang.NullPointerException

startPrefixMapping

private boolean startPrefixMapping(java.lang.String prefix,
                                   java.lang.String uri)
                            throws org.xml.sax.SAXException
Begin the scope of namespace prefix. Forward the event to the SAX handler only if the prefix is unknown or it is mapped to a different URI.

Throws:
org.xml.sax.SAXException

endPrefixMapping

private void endPrefixMapping(java.lang.String prefix)
                       throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

getLocalName

private static java.lang.String getLocalName(org.w3c.dom.Node node)
If the DOM was created using a DOM 1.0 API, the local name may be null. If so, get the local name from the qualified name before generating the SAX event.


parse

public void parse(org.xml.sax.InputSource unused)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException

parse

public void parse()
           throws java.io.IOException,
                  org.xml.sax.SAXException
Throws:
java.io.IOException
org.xml.sax.SAXException

parse

private void parse(org.w3c.dom.Node node)
            throws java.io.IOException,
                   org.xml.sax.SAXException
Traverse the DOM and generate SAX events for a handler. A startElement() event passes all attributes, including namespace declarations.

Throws:
java.io.IOException
org.xml.sax.SAXException

getDTDHandler

public org.xml.sax.DTDHandler getDTDHandler()
This class is only used internally so this method should never be called.

Specified by:
getDTDHandler in interface org.xml.sax.XMLReader

getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
This class is only used internally so this method should never be called.

Specified by:
getErrorHandler in interface org.xml.sax.XMLReader

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
This class is only used internally so this method should never be called.

Specified by:
getFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
This class is only used internally so this method should never be called.

Specified by:
setFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

parse

public void parse(java.lang.String sysId)
           throws java.io.IOException,
                  org.xml.sax.SAXException
This class is only used internally so this method should never be called.

Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException

setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler handler)
                   throws java.lang.NullPointerException
This class is only used internally so this method should never be called.

Specified by:
setDTDHandler in interface org.xml.sax.XMLReader
Throws:
java.lang.NullPointerException

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver resolver)
                       throws java.lang.NullPointerException
This class is only used internally so this method should never be called.

Specified by:
setEntityResolver in interface org.xml.sax.XMLReader
Throws:
java.lang.NullPointerException

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
This class is only used internally so this method should never be called.

Specified by:
getEntityResolver in interface org.xml.sax.XMLReader

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler handler)
                     throws java.lang.NullPointerException
This class is only used internally so this method should never be called.

Specified by:
setErrorHandler in interface org.xml.sax.XMLReader
Throws:
java.lang.NullPointerException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
This class is only used internally so this method should never be called.

Specified by:
setProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
This class is only used internally so this method should never be called.

Specified by:
getProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getColumnNumber

public int getColumnNumber()
This class is only used internally so this method should never be called.

Specified by:
getColumnNumber in interface org.xml.sax.Locator

getLineNumber

public int getLineNumber()
This class is only used internally so this method should never be called.

Specified by:
getLineNumber in interface org.xml.sax.Locator

getPublicId

public java.lang.String getPublicId()
This class is only used internally so this method should never be called.

Specified by:
getPublicId in interface org.xml.sax.Locator

getSystemId

public java.lang.String getSystemId()
This class is only used internally so this method should never be called.

Specified by:
getSystemId in interface org.xml.sax.Locator

getNodeTypeFromCode

private java.lang.String getNodeTypeFromCode(short code)