|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xml.dtm.ref.DTMDefaultBase
org.apache.xml.dtm.ref.DTMDefaultBaseTraversers
org.apache.xml.dtm.ref.DTMDefaultBaseIterators
org.apache.xalan.lib.sql.DTMDocument
public class DTMDocument
The SQL Document is the main controlling class the executesa SQL Query
Nested Class Summary | |
---|---|
static interface |
DTMDocument.CharacterNodeHandler
|
Field Summary |
---|
Fields inherited from class org.apache.xml.dtm.ref.DTMDefaultBase |
---|
DEFAULT_BLOCKSIZE, DEFAULT_NUMBLOCKS, DEFAULT_NUMBLOCKS_SMALL, m_mgr, ROOTNODE |
Fields inherited from interface org.apache.xml.dtm.DTM |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NAMESPACE_NODE, NOTATION_NODE, NTYPES, NULL, PROCESSING_INSTRUCTION_NODE, ROOT_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
DTMDocument(DTMManager mgr,
int ident)
|
Method Summary | |
---|---|
void |
appendChild(int parm1,
boolean parm2,
boolean parm3)
Append a child to the end of the document. |
void |
appendTextChild(java.lang.String parm1)
Append a text node child that will be constructed from a string, to the end of the document. |
void |
dispatchCharactersEvents(int nodeHandle,
org.xml.sax.ContentHandler ch,
boolean normalize)
Directly call the characters method on the passed ContentHandler for the string-value of the given node (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). |
void |
dispatchToEvents(int parm1,
org.xml.sax.ContentHandler parm2)
Directly create SAX parser events from a subtree. |
void |
dumpDTM()
|
int |
getAttributeNode(int parm1,
java.lang.String parm2,
java.lang.String parm3)
Retrieves an attribute node by by qualified name and namespace URI. |
DTMAxisIterator |
getAxisIterator(int parm1)
This is a shortcut to the iterators that implement the XPath axes. |
DTMAxisTraverser |
getAxisTraverser(int parm1)
This returns a stateless "traverser", that can navigate over an XPath axis, though perhaps not in document order. |
org.xml.sax.ContentHandler |
getContentHandler()
Return this DTM's content handler, if it has one. |
org.xml.sax.ext.DeclHandler |
getDeclHandler()
Return this DTM's DeclHandler, if it has one. |
int |
getDocument()
Find the Document node handle for the document currently under construction. |
boolean |
getDocumentAllDeclarationsProcessed()
Return an indication of whether the processor has read the complete DTD. |
java.lang.String |
getDocumentBaseURI()
Return the base URI of the document entity. |
java.lang.String |
getDocumentEncoding(int parm1)
Return the name of the character encoding scheme in which the document entity is expressed. |
java.lang.String |
getDocumentStandalone(int parm1)
Return an indication of the standalone status of the document, either "yes" or "no". |
java.lang.String |
getDocumentSystemIdentifier(int parm1)
Return the system identifier of the document entity. |
java.lang.String |
getDocumentTypeDeclarationPublicIdentifier()
Return the public identifier of the external subset, normalized as described in 4.2.2 External Entities [XML]. |
java.lang.String |
getDocumentTypeDeclarationSystemIdentifier()
A document type declaration information item has the following properties: 1. |
java.lang.String |
getDocumentVersion(int parm1)
Return a string representing the XML version of the document. |
org.xml.sax.DTDHandler |
getDTDHandler()
Return this DTM's DTDHandler, if it has one. |
int |
getElementById(java.lang.String parm1)
Returns the Element whose ID is given by
elementId . |
org.xml.sax.EntityResolver |
getEntityResolver()
Return this DTM's EntityResolver, if it has one. |
org.xml.sax.ErrorHandler |
getErrorHandler()
Return this DTM's ErrorHandler, if it has one. |
int |
getExpandedTypeID(int parm1)
Given a node handle, return an ID that represents the node's expanded name. |
int |
getExpandedTypeID(java.lang.String parm1,
java.lang.String parm2,
int parm3)
Given an expanded name, return an ID. |
int |
getFirstAttribute(int parm1)
Given a node handle, get the index of the node's first attribute. |
int |
getFirstChild(int parm1)
Given a node handle, get the handle of the node's first child. |
int |
getFirstNamespaceNode(int parm1,
boolean parm2)
Given a node handle, get the index of the node's first child. |
int |
getLastChild(int parm1)
Given a node handle, advance to its last child. |
short |
getLevel(int parm1)
Get the depth level of this node in the tree (equals 1 for a parentless node). |
org.xml.sax.ext.LexicalHandler |
getLexicalHandler()
Return this DTM's lexical handler, if it has one. |
java.lang.String |
getLocalName(int parm1)
Given a node handle, return its XPath-style localname. |
java.lang.String |
getLocalNameFromExpandedNameID(int parm1)
Given an expanded-name ID, return the local name part. |
java.lang.String |
getNamespaceFromExpandedNameID(int parm1)
Given an expanded-name ID, return the namespace URI part. |
int |
getNamespaceType(int parm1)
Returns the namespace type of a specific node |
java.lang.String |
getNamespaceURI(int parm1)
Given a node handle, return its DOM-style namespace URI (As defined in Namespaces, this is the declared URI which this node's prefix -- or default in lieu thereof -- was mapped to.) |
int |
getNextAttribute(int parm1)
Given a node handle, advance to the next attribute. |
int |
getNextNamespaceNode(int parm1,
int parm2,
boolean parm3)
Given a namespace handle, advance to the next namespace. |
int |
getNextSibling(int parm1)
Given a node handle, advance to its next sibling. |
org.w3c.dom.Node |
getNode(int parm1)
Return an DOM node for the given node. |
java.lang.String |
getNodeName(int parm1)
Given a node handle, return its DOM-style node name. |
java.lang.String |
getNodeNameX(int parm1)
Given a node handle, return the XPath node name. |
short |
getNodeType(int parm1)
Given a node handle, return its DOM-style node type. |
java.lang.String |
getNodeValue(int parm1)
Given a node handle, return its node value. |
int |
getOwnerDocument(int parm1)
Given a node handle, find the owning document node. |
int |
getParent(int parm1)
Given a node handle, find its parent node. |
java.lang.String |
getPrefix(int parm1)
Given a namespace handle, return the prefix that the namespace decl is mapping. |
int |
getPreviousSibling(int parm1)
Given a node handle, find its preceeding sibling. |
javax.xml.transform.SourceLocator |
getSourceLocatorFor(int node)
No source information is available for DOM2DTM, so return null here. |
XMLString |
getStringValue(int nodeHandle)
Get the string-value of a node as a String object (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). |
char[] |
getStringValueChunk(int parm1,
int parm2,
int[] parm3)
Get a character array chunk in the string-value of a node. |
int |
getStringValueChunkCount(int parm1)
Get number of character array chunks in the string-value of a node. |
DTMAxisIterator |
getTypedAxisIterator(int parm1,
int parm2)
Get an iterator that can navigate over an XPath Axis, predicated by the extended type ID. |
java.lang.String |
getUnparsedEntityURI(java.lang.String parm1)
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]). |
boolean |
hasChildNodes(int parm1)
Given a node handle, test if it has child nodes. |
boolean |
isAttributeSpecified(int parm1)
5. |
boolean |
isCharacterElementContentWhitespace(int parm1)
2. |
boolean |
isDocumentAllDeclarationsProcessed(int parm1)
10. |
boolean |
isNodeAfter(int parm1,
int parm2)
Figure out whether nodeHandle2 should be considered as being later in the document than nodeHandle1, in Document Order as defined by the XPath model. |
boolean |
isSupported(java.lang.String parm1,
java.lang.String parm2)
Tests whether DTM DOM implementation implements a specific feature and that feature is supported by this node. |
boolean |
needsTwoThreads()
|
void |
setDocumentBaseURI(java.lang.String parm1)
Set the base URI of the document entity. |
void |
setFeature(java.lang.String parm1,
boolean parm2)
Set an implementation dependent feature. |
void |
setProperty(java.lang.String property,
java.lang.Object value)
For the moment all the run time properties are ignored by this class. |
boolean |
supportsPreStripping()
Event overriding for Debug |
Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBase |
---|
documentRegistration, documentRelease, dumpDTM, dumpNode, getDocumentRoot, getDTMIDs, getManager, getNodeHandle, getNodeIdent, getTypedFirstChild, getTypedNextSibling, makeNodeHandle, makeNodeIdentity, migrateTo |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DTMDocument(DTMManager mgr, int ident)
mgr
- ident
- Method Detail |
---|
public int getFirstAttribute(int parm1)
DTMDefaultBase
getFirstAttribute
in interface DTM
getFirstAttribute
in class DTMDefaultBase
parm1
-
public java.lang.String getNodeValue(int parm1)
DTMDefaultBase
getNodeValue
in interface DTM
getNodeValue
in class DTMDefaultBase
parm1
-
public XMLString getStringValue(int nodeHandle)
getStringValue
in interface DTM
getStringValue
in class DTMDefaultBase
nodeHandle
- The node ID.
public int getNextAttribute(int parm1)
DTMDefaultBase
getNextAttribute
in interface DTM
getNextAttribute
in class DTMDefaultBase
parm1
-
public void dumpDTM()
public void setProperty(java.lang.String property, java.lang.Object value)
property
- a String
valuevalue
- an Object
valuepublic javax.xml.transform.SourceLocator getSourceLocatorFor(int node)
null
here.
node
- an int
value
public int getAttributeNode(int parm1, java.lang.String parm2, java.lang.String parm3)
DTMDefaultBase
getAttributeNode
in interface DTM
getAttributeNode
in class DTMDefaultBase
parm1
- parm2
- parm3
-
nodeName
) or DTM.NULL
if there is no such
attribute.public java.lang.String getLocalName(int parm1)
DTMDefaultBase
getLocalName
in interface DTM
getLocalName
in class DTMDefaultBase
parm1
-
public java.lang.String getNodeName(int parm1)
DTMDefaultBase
getNodeName
in interface DTM
getNodeName
in class DTMDefaultBase
parm1
-
public boolean isAttributeSpecified(int parm1)
DTMDefaultBase
isAttributeSpecified
in interface DTM
isAttributeSpecified
in class DTMDefaultBase
parm1
-
true
if the attribute was specified;
false
if it was defaulted.public java.lang.String getUnparsedEntityURI(java.lang.String parm1)
DTMDefaultBase
XML processors may choose to use the System Identifier (if one is provided) to resolve the entity, rather than the URI in the Public Identifier. The details are dependent on the processor, and we would have to support some form of plug-in resolver to handle this properly. Currently, we simply return the System Identifier if present, and hope that it a usable URI or that our caller can map it to one. TODO: Resolve Public Identifiers... or consider changing function name.
If we find a relative URI reference, XML expects it to be resolved in terms of the base URI of the document. The DOM doesn't do that for us, and it isn't entirely clear whether that should be done here; currently that's pushed up to a higher level of our application. (Note that DOM Level 1 didn't store the document's base URI.) TODO: Consider resolving Relative URIs.
(The DOM's statement that "An XML processor may choose to completely expand entities before the structure model is passed to the DOM" refers only to parsed entities, not unparsed, and hence doesn't affect this function.)
getUnparsedEntityURI
in interface DTM
getUnparsedEntityURI
in class DTMDefaultBase
parm1
-
public org.xml.sax.DTDHandler getDTDHandler()
DTM
public java.lang.String getPrefix(int parm1)
DTMDefaultBase
%REVIEW% Are you sure you want "" for no prefix?
%REVIEW-COMMENT% I think so... not totally sure. -sb
getPrefix
in interface DTM
getPrefix
in class DTMDefaultBase
parm1
-
public org.xml.sax.EntityResolver getEntityResolver()
DTM
public java.lang.String getDocumentTypeDeclarationPublicIdentifier()
DTMDefaultBase
getDocumentTypeDeclarationPublicIdentifier
in interface DTM
getDocumentTypeDeclarationPublicIdentifier
in class DTMDefaultBase
public org.xml.sax.ext.LexicalHandler getLexicalHandler()
DTM
public boolean needsTwoThreads()
public org.xml.sax.ContentHandler getContentHandler()
DTM
public void dispatchToEvents(int parm1, org.xml.sax.ContentHandler parm2) throws org.xml.sax.SAXException
DTMDefaultBase
dispatchToEvents
in interface DTM
dispatchToEvents
in class DTMDefaultBase
parm1
- parm2
-
org.xml.sax.SAXException
public java.lang.String getNamespaceURI(int parm1)
DTMDefaultBase
%REVIEW% Null or ""? -sb
getNamespaceURI
in interface DTM
getNamespaceURI
in class DTMDefaultBase
parm1
-
public void dispatchCharactersEvents(int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException
DTMDefaultBase
dispatchCharactersEvents
in interface DTM
dispatchCharactersEvents
in class DTMDefaultBase
nodeHandle
- ch
- normalize
-
org.xml.sax.SAXException
public boolean supportsPreStripping()
supportsPreStripping
in interface DTM
supportsPreStripping
in class DTMDefaultBase
public org.w3c.dom.Node getNode(int parm1)
DTMDefaultBase
getNode
in interface DTM
getNode
in class DTMDefaultBase
parm1
-
public int getPreviousSibling(int parm1)
DTMDefaultBase
getPreviousSibling
in interface DTM
getPreviousSibling
in class DTMDefaultBase
parm1
-
public java.lang.String getDocumentStandalone(int parm1)
DTMDefaultBase
getDocumentStandalone
in interface DTM
getDocumentStandalone
in class DTMDefaultBase
parm1
-
public java.lang.String getNodeNameX(int parm1)
DTMDefaultBase
getNodeNameX
in interface DTM
getNodeNameX
in class DTMDefaultBase
parm1
-
public void setFeature(java.lang.String parm1, boolean parm2)
DTMDefaultBase
%REVIEW% Do we really expect to set features on DTMs?
setFeature
in interface DTM
setFeature
in class DTMDefaultBase
parm1
- parm2
- public boolean isNodeAfter(int parm1, int parm2)
DTMDefaultBase
There are some cases where ordering isn't defined, and neither are the results of this function -- though we'll generally return false.
isNodeAfter
in interface DTM
isNodeAfter
in class DTMDefaultBase
parm1
- parm2
-
(node1.documentOrderPosition <= node2.documentOrderPosition)
.public int getNamespaceType(int parm1)
DTMDefaultBase
getNamespaceType
in class DTMDefaultBase
parm1
-
public java.lang.String getDocumentVersion(int parm1)
DTMDefaultBase
getDocumentVersion
in interface DTM
getDocumentVersion
in class DTMDefaultBase
parm1
-
public boolean isSupported(java.lang.String parm1, java.lang.String parm2)
DTMDefaultBase
isSupported
in interface DTM
isSupported
in class DTMDefaultBase
parm1
- parm2
-
true
if the specified feature is
supported on this node, false
otherwise.public java.lang.String getDocumentEncoding(int parm1)
DTMDefaultBase
getDocumentEncoding
in interface DTM
getDocumentEncoding
in class DTMDefaultBase
parm1
-
public void appendChild(int parm1, boolean parm2, boolean parm3)
DTMDefaultBase
%REVIEW% "End of the document" needs to be defined more clearly. Does it become the last child of the Document? Of the root element?
appendChild
in interface DTM
appendChild
in class DTMDefaultBase
parm1
- parm2
- parm3
- public short getLevel(int parm1)
DTMDefaultBase
getLevel
in interface DTM
getLevel
in class DTMDefaultBase
parm1
-
public java.lang.String getDocumentBaseURI()
DTMDefaultBase
getDocumentBaseURI
in interface DTM
getDocumentBaseURI
in class DTMDefaultBase
public int getNextNamespaceNode(int parm1, int parm2, boolean parm3)
DTMDefaultBase
getNextNamespaceNode
in interface DTM
getNextNamespaceNode
in class DTMDefaultBase
parm1
- parm2
- parm3
-
public void appendTextChild(java.lang.String parm1)
DTMDefaultBase
%REVIEW% "End of the document" needs to be defined more clearly. Does it become the last child of the Document? Of the root element?
appendTextChild
in interface DTM
appendTextChild
in class DTMDefaultBase
parm1
- public int getFirstNamespaceNode(int parm1, boolean parm2)
DTMDefaultBase
getFirstNamespaceNode
in interface DTM
getFirstNamespaceNode
in class DTMDefaultBase
parm1
- parm2
-
public int getStringValueChunkCount(int parm1)
DTMDefaultBase
getStringValueChunkCount
in interface DTM
getStringValueChunkCount
in class DTMDefaultBase
parm1
-
public int getLastChild(int parm1)
DTMDefaultBase
getLastChild
in interface DTM
getLastChild
in class DTMDefaultBase
parm1
-
public boolean hasChildNodes(int parm1)
DTMDefaultBase
%REVIEW% This is obviously useful at the DOM layer, where it would permit testing this without having to create a proxy node. It's less useful in the DTM API, where (dtm.getFirstChild(nodeHandle)!=DTM.NULL) is just as fast and almost as self-evident. But it's a convenience, and eases porting of DOM code to DTM.
hasChildNodes
in interface DTM
hasChildNodes
in class DTMDefaultBase
parm1
-
public short getNodeType(int parm1)
DTMDefaultBase
%REVIEW% Generally, returning short is false economy. Return int? %REVIEW% Make assumption that node has already arrived. Is OK?
getNodeType
in interface DTM
getNodeType
in class DTMDefaultBase
parm1
-
public boolean isCharacterElementContentWhitespace(int parm1)
DTMDefaultBase
isCharacterElementContentWhitespace
in interface DTM
isCharacterElementContentWhitespace
in class DTMDefaultBase
parm1
-
true
if the character data is whitespace;
false
otherwise.public int getFirstChild(int parm1)
DTMDefaultBase
getFirstChild
in interface DTM
getFirstChild
in class DTMDefaultBase
parm1
-
public java.lang.String getDocumentSystemIdentifier(int parm1)
DTMDefaultBase
getDocumentSystemIdentifier
in interface DTM
getDocumentSystemIdentifier
in class DTMDefaultBase
parm1
-
public java.lang.String getNamespaceFromExpandedNameID(int parm1)
DTMDefaultBase
getNamespaceFromExpandedNameID
in interface DTM
getNamespaceFromExpandedNameID
in class DTMDefaultBase
parm1
-
public java.lang.String getLocalNameFromExpandedNameID(int parm1)
DTMDefaultBase
getLocalNameFromExpandedNameID
in interface DTM
getLocalNameFromExpandedNameID
in class DTMDefaultBase
parm1
-
public int getExpandedTypeID(int parm1)
DTMDefaultBase
getExpandedTypeID
in interface DTM
getExpandedTypeID
in class DTMDefaultBase
parm1
-
public int getDocument()
DTMDefaultBase
getDocument
in interface DTM
getDocument
in class DTMDefaultBase
public boolean isDocumentAllDeclarationsProcessed(int parm1)
DTMDefaultBase
isDocumentAllDeclarationsProcessed
in interface DTM
isDocumentAllDeclarationsProcessed
in class DTMDefaultBase
parm1
-
true
if all declarations were processed;
false
otherwise.public int getOwnerDocument(int parm1)
DTMDefaultBase
%REVIEW% Since this is DOM-specific, it may belong at the DOM binding layer. Included here as a convenience function and to aid porting of DOM code to DTM.
getOwnerDocument
in interface DTM
getOwnerDocument
in class DTMDefaultBase
parm1
-
DTM.getDocumentRoot(int nodeHandle)
public int getNextSibling(int parm1)
DTMDefaultBase
getNextSibling
in interface DTM
getNextSibling
in class DTMDefaultBase
parm1
-
public boolean getDocumentAllDeclarationsProcessed()
DTMDefaultBase
getDocumentAllDeclarationsProcessed
in interface DTM
getDocumentAllDeclarationsProcessed
in class DTMDefaultBase
true
if all declarations were processed;
false
otherwise.public int getParent(int parm1)
DTMDefaultBase
getParent
in interface DTM
getParent
in class DTMDefaultBase
parm1
-
public int getExpandedTypeID(java.lang.String parm1, java.lang.String parm2, int parm3)
DTMDefaultBase
getExpandedTypeID
in interface DTM
getExpandedTypeID
in class DTMDefaultBase
parm1
- parm2
- parm3
-
public void setDocumentBaseURI(java.lang.String parm1)
DTMDefaultBase
setDocumentBaseURI
in interface DTM
setDocumentBaseURI
in class DTMDefaultBase
parm1
- public char[] getStringValueChunk(int parm1, int parm2, int[] parm3)
DTMDefaultBase
getStringValueChunk
in interface DTM
getStringValueChunk
in class DTMDefaultBase
parm1
- parm2
- parm3
-
public DTMAxisTraverser getAxisTraverser(int parm1)
DTMDefaultBaseTraversers
getAxisTraverser
in interface DTM
getAxisTraverser
in class DTMDefaultBaseTraversers
parm1
-
public DTMAxisIterator getTypedAxisIterator(int parm1, int parm2)
DTMDefaultBaseIterators
getTypedAxisIterator
in interface DTM
getTypedAxisIterator
in class DTMDefaultBaseIterators
parm1
- parm2
-
public DTMAxisIterator getAxisIterator(int parm1)
DTMDefaultBaseIterators
getAxisIterator
in interface DTM
getAxisIterator
in class DTMDefaultBaseIterators
parm1
-
public int getElementById(java.lang.String parm1)
DTMDefaultBase
Element
whose ID
is given by
elementId
. If no such element exists, returns
DTM.NULL
. Behavior is not defined if more than one element
has this ID
. Attributes (including those
with the name "ID") are not of type ID unless so defined by DTD/Schema
information available to the DTM implementation.
Implementations that do not know whether attributes are of type ID or
not are expected to return DTM.NULL
.
%REVIEW% Presumably IDs are still scoped to a single document, and this operation searches only within a single document, right? Wouldn't want collisions between DTMs in the same process.
getElementById
in interface DTM
getElementById
in class DTMDefaultBase
parm1
-
public org.xml.sax.ext.DeclHandler getDeclHandler()
DTM
public org.xml.sax.ErrorHandler getErrorHandler()
DTM
public java.lang.String getDocumentTypeDeclarationSystemIdentifier()
DTMDefaultBase
getDocumentTypeDeclarationSystemIdentifier
in interface DTM
getDocumentTypeDeclarationSystemIdentifier
in class DTMDefaultBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |