## org.apache.xalan.xpath.dtm
Class DTMLiaison

    java.lang.Object
      |
      +--org.apache.xalan.xpath.XPathSupportDefault
            |
            +--org.apache.xalan.xpath.xml.XMLParserLiaisonDefault
                  |
                  +--org.apache.xalan.xpath.xdom.XercesLiaison
                        |
                        +--org.apache.xalan.xpath.dtm.DTMLiaison

public class DTMLiaison
extends XercesLiaison

**For internal use only** Liaison to Document Table Model (DTM) XML parser -- the default liaison and parser that XSLTProcessor uses to perform transformations. To enhance performance, DTM uses integer arrays to represent a DOM. If you are reading or writing a DOM, use XercesLiaison.

See Also:
  `XSLTProcessor`, `XercesLiaison`

Fields inherited from class org.apache.xalan.xpath.xml.XMLParserLiaisonDefault
`m_attrSpecialChars, m_extensionFunctionNamespaces`

Constructor Summary
`DTMLiaison()` **For internal use only** Construct an instance.
`DTMLiaison(org.xml.sax.ErrorHandler errorHandler)` **For internal use only** Constructor that takes SAX ErrorHandler as an argument.
`DTMLiaison(XPathEnvSupport envSupport)` **For internal use only** Construct an instance.

Method Summary
`void` `checkNode(org.w3c.dom.Node node)` **For internal use only** Check node to see if it matches this liaison.
`XLocator` `createXLocatorHandler()` **For internal use only** getXLocatorHandler.
`XPathFactory` `getDefaultXPathFactory()` **For internal use only** Get a factory to create XPaths.
`org.w3c.dom.Element` `getElementByID(java.lang.String id, org.w3c.dom.Document doc)` **For internal use only** Given an ID, return the element.
`java.lang.String` `getLocalNameOfNode(org.w3c.dom.Node n)` **For internal use only** Returns the local name of the given node.
`java.lang.String` `getNamespaceOfNode(org.w3c.dom.Node n)` **For internal use only** Returns the namespace of the given node.
`int` `getNodeNumber(org.w3c.dom.Node node)` **For internal use only**
`org.w3c.dom.Node` `getParentOfNode(org.w3c.dom.Node n)` **For internal use only** Get the parent of a node.
`java.lang.String` `getUnparsedEntityURI(java.lang.String name, org.w3c.dom.Document doc)` **For internal use only** The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]).
`XLocator` `getXLocatorFromNode(org.w3c.dom.Node node)` **For internal use only** Get an XLocator provider keyed by node.
`void` `parse(org.xml.sax.InputSource source)` **For internal use only** Parse an XML document.
`void` `setShouldExpandEntityRefs(boolean b)` **For internal use only** Set whether or not to expand all entity references in the source and style trees.
`boolean` `supportsNodeNumber(org.w3c.dom.Node n)` **For internal use only**
`boolean` `supportsSAX()` **For internal use only** Returns true if the liaison supports the SAX DocumentHandler interface.

Methods inherited from class org.apache.xalan.xpath.xdom.XercesLiaison
`copyFromOtherLiaison, createDocument, getParserDescription, isIgnorableWhitespace, setUseDOM2getNamespaceURI`

Methods inherited from class org.apache.xalan.xpath.xml.XMLParserLiaisonDefault

`addExtensionElementNamespace, addExtensionNamespace, associateXLocatorToNode, deassociateXLocatorToNode, elementAvailable, error, error, error, extFunction, findURIFromDoc, functionAvailable, getAcceptLanguage, getCallback, getCallbackInfo, getDocument, getDOMFactory, getEntityResolver, getErrorHandler, getExpandedAttributeName, getExpandedElementName, getIndent, getNamespaceForPrefix, getNodeData, getNodeData, getNodeSetByKey, getProblemListener, getProcessNamespaces, getRoot, getShouldExpandEntityRefs, getSourceDocsTable, getSpecialCharacters, getThrowFoundIndex, getURLFromString, getUseValidation, getVariable, parse, problem, reset, setAcceptLanguage, setCallback, setDocumentHandler, setDOMFactory, setDTDHandler, setEntityResolver, setEnvSupport, setErrorHandler, setIndent, setLocale, setProblemListener, setProcessNamespaces, setSpecialCharacters, setThrowFoundIndex, setUseValidation, shouldStripSourceNode, toMarkup, toMarkup, warn, warn, warn, warning`

Methods inherited from class org.apache.xalan.xpath.XPathSupportDefault

`beginConstruction, decrementContextNodePosition, endConstruction, getContextNodeList, getContextNodePosition, getCurrentNode, getInConstruction, getNamespaceContext, incrementContextNodePosition, parseXML, parseXML, popContextNodeList, popContextNodePosition, popXPathContext, pushContextNodeList, pushContextNodePosition, pushDummyXPathContext, pushXPathContext, reExecuteXPathContext, setContextNodePosition, setCurrentNode, setNamespaceContext`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DTMLiaison

    public DTMLiaison(org.xml.sax.ErrorHandler errorHandler)

  **For internal use only** Constructor that takes SAX ErrorHandler as an argument. The error handler is registered with the XML Parser. Any XML-related errors will be reported to the calling application using this error handler.
  Parameters:
    `errorHandler` - SAX ErrorHandler instance.

### DTMLiaison

    public DTMLiaison(XPathEnvSupport envSupport)

  **For internal use only** Construct an instance.

### DTMLiaison

    public DTMLiaison()

  **For internal use only** Construct an instance.

Method Detail

### setShouldExpandEntityRefs

    public void setShouldExpandEntityRefs(boolean b)

  **For internal use only** Set whether or not to expand all entity references in the source and style trees. Not supported for DTM. Entities will be expanded by default.
  Overrides:
    setShouldExpandEntityRefs in class XMLParserLiaisonDefault

### checkNode

    public void checkNode(org.w3c.dom.Node node)
                   throws org.xml.sax.SAXException

  **For internal use only** Check node to see if it matches this liaison.
  Overrides:
    checkNode in class XercesLiaison

### parse

    public void parse(org.xml.sax.InputSource source)
               throws org.xml.sax.SAXException,
                      java.io.IOException

  **For internal use only** Parse an XML document.

  The application can use this method to instruct the SAX parser to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

  Applications may not invoke this method while a parse is in progress (they should create a new Parser instead for each additional XML document). Once a parse is complete, an application may reuse the same Parser object, possibly with a different input source.

  Parameters:
    `source` - The input source for the top-level of the XML document.
  Throws:
    org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
    java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
  Overrides:
    parse in class XercesLiaison
  See Also:
    `InputSource`, `XMLParserLiaisonDefault.parse(java.lang.String)`, `XMLParserLiaisonDefault.setEntityResolver(org.xml.sax.EntityResolver)`, `XMLParserLiaisonDefault.setDTDHandler(org.xml.sax.DTDHandler)`, `XMLParserLiaisonDefault.setDocumentHandler(org.xml.sax.DocumentHandler)`, `XMLParserLiaisonDefault.setErrorHandler(org.xml.sax.ErrorHandler)`

### supportsSAX

    public boolean supportsSAX()

  **For internal use only** Returns true if the liaison supports the SAX DocumentHandler interface. The default is that the parser does not support the SAX interface.
  Overrides:
    supportsSAX in class XercesLiaison

### getNamespaceOfNode

    public java.lang.String getNamespaceOfNode(org.w3c.dom.Node n)

  **For internal use only** Returns the namespace of the given node.
  Overrides:
    getNamespaceOfNode in class XercesLiaison

### getLocalNameOfNode

    public java.lang.String getLocalNameOfNode(org.w3c.dom.Node n)

  **For internal use only** Returns the local name of the given node.
  Overrides:
    getLocalNameOfNode in class XMLParserLiaisonDefault

### getParentOfNode

    public org.w3c.dom.Node getParentOfNode(org.w3c.dom.Node n)
                                     throws java.lang.RuntimeException

  **For internal use only** Get the parent of a node.
  Overrides:
    getParentOfNode in class XercesLiaison

### getElementByID

    public org.w3c.dom.Element getElementByID(java.lang.String id,
                                              org.w3c.dom.Document doc)

  **For internal use only** Given an ID, return the element.
  Overrides:
    getElementByID in class XercesLiaison

### getUnparsedEntityURI

    public java.lang.String getUnparsedEntityURI(java.lang.String name,
                                                 org.w3c.dom.Document doc)

  **For internal use only** The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]). It returns the empty string if there is no such entity. (Should this go here or in the XLocator??) Since it states in the DOM draft: "An XML processor may choose to completely expand entities before the structure model is passed to the DOM; in this case, there will be no EntityReferences in the DOM tree." So I'm not sure how well this is going to work.
  Overrides:
    getUnparsedEntityURI in class XMLParserLiaisonDefault

### getDefaultXPathFactory

    public XPathFactory getDefaultXPathFactory()

  **For internal use only** Get a factory to create XPaths.
  Overrides:
    getDefaultXPathFactory in class XMLParserLiaisonDefault

### getXLocatorFromNode

    public XLocator getXLocatorFromNode(org.w3c.dom.Node node)

  **For internal use only** Get an XLocator provider keyed by node. This get's the association based on the root of the tree that the node is parented by.
  Overrides:
    getXLocatorFromNode in class XMLParserLiaisonDefault

### createXLocatorHandler

    public XLocator createXLocatorHandler()

  **For internal use only** getXLocatorHandler.
  Overrides:
    createXLocatorHandler in class XMLParserLiaisonDefault

### supportsNodeNumber

    public boolean supportsNodeNumber(org.w3c.dom.Node n)

  Overrides:
    supportsNodeNumber in class XPathSupportDefault

### getNodeNumber

    public int getNodeNumber(org.w3c.dom.Node node)

  Overrides:
    getNodeNumber in class XPathSupportDefault

Copyright © 2000 Apache XML Project. All Rights Reserved.