BEA Systems, Inc.

WebLogic Server 6.0sp2 API Reference

weblogic.apache.xalan.xpath.dtm
Class DTMLiaison

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

public class DTMLiaison
extends XercesLiaison

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.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Author:
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
XSLTProcessor, XercesLiaison

Fields inherited from class weblogic.apache.xalan.xpath.xdom.XercesLiaison
m_parseCountSinceGC, m_useDOM2getNamespaceURI
 
Fields inherited from class weblogic.apache.xalan.xpath.xml.XMLParserLiaisonDefault
m_acceptLanguage, m_attrSpecialChars, m_candidateNoAncestorXMLNS, m_dataProviders, m_docHandler, m_document, m_DOMFactory, m_DTDHandler, m_entityResolver, m_envSupport, m_errorHandler, m_extensionFunctionNamespaces, m_formatterListener, m_indent, m_isDefaultUseValidation, m_locale, m_NSInfoNullNoAncestorXMLNS, m_NSInfoNullWithoutXMLNS, m_NSInfoNullWithXMLNS, m_NSInfoUnProcNoAncestorXMLNS, m_NSInfoUnProcWithoutXMLNS, m_NSInfoUnProcWithXMLNS, m_processNamespaces, m_shouldExpandEntityRefs, m_use_validation
 
Constructor Summary
DTMLiaison()
          Construct an instance.
DTMLiaison(org.xml.sax.ErrorHandler errorHandler)
          Constructor that takes SAX ErrorHandler as an argument.
DTMLiaison(XPathEnvSupport envSupport)
          Construct an instance.
 
Method Summary
 void checkNode(org.w3c.dom.Node node)
          Check node to see if it matches this liaison.
 XLocator createXLocatorHandler()
          getXLocatorHandler.
 XPathFactory getDefaultXPathFactory()
          Get a factory to create XPaths.
 org.w3c.dom.Element getElementByID(java.lang.String id, org.w3c.dom.Document doc)
          Given an ID, return the element.
 java.lang.String getLocalNameOfNode(org.w3c.dom.Node n)
          Returns the local name of the given node.
 java.lang.String getNamespaceOfNode(org.w3c.dom.Node n)
          Returns the namespace of the given node.
 int getNodeNumber(org.w3c.dom.Node node)
           
 org.w3c.dom.Node getParentOfNode(org.w3c.dom.Node n)
          Get the parent of a node.
 java.lang.String getUnparsedEntityURI(java.lang.String name, org.w3c.dom.Document doc)
          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)
          Get an XLocator provider keyed by node.
 void parse(org.xml.sax.InputSource source)
          Parse an XML document.
 void setShouldExpandEntityRefs(boolean b)
          Set whether or not to expand all entity references in the source and style trees.
 boolean supportsNodeNumber(org.w3c.dom.Node n)
           
 boolean supportsSAX()
          Returns true if the liaison supports the SAX DocumentHandler interface.
 
Methods inherited from class weblogic.apache.xalan.xpath.xdom.XercesLiaison
copyFromOtherLiaison, createDocument, getParserDescription, isIgnorableWhitespace, setUseDOM2getNamespaceURI
 
Methods inherited from class weblogic.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 weblogic.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTMLiaison

public DTMLiaison(org.xml.sax.ErrorHandler errorHandler)
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)
Construct an instance.

DTMLiaison

public DTMLiaison()
Construct an instance.
Method Detail

setShouldExpandEntityRefs

public void setShouldExpandEntityRefs(boolean b)
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
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
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()
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)
Returns the namespace of the given node.

Overrides:
getNamespaceOfNode in class XercesLiaison

getLocalNameOfNode

public java.lang.String getLocalNameOfNode(org.w3c.dom.Node n)
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
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)
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)
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()
Get a factory to create XPaths.

Overrides:
getDefaultXPathFactory in class XMLParserLiaisonDefault

getXLocatorFromNode

public XLocator getXLocatorFromNode(org.w3c.dom.Node node)
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()
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

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs60