public class DTMDocument extends DTMDefaultBaseIterators
| Modifier and Type | Class and Description |
|---|---|
static interface |
DTMDocument.CharacterNodeHandler |
DTMDefaultBaseIterators.AncestorIterator, DTMDefaultBaseIterators.AttributeIterator, DTMDefaultBaseIterators.ChildrenIterator, DTMDefaultBaseIterators.DescendantIterator, DTMDefaultBaseIterators.FollowingIterator, DTMDefaultBaseIterators.FollowingSiblingIterator, DTMDefaultBaseIterators.InternalAxisIteratorBase, DTMDefaultBaseIterators.NamespaceAttributeIterator, DTMDefaultBaseIterators.NamespaceChildrenIterator, DTMDefaultBaseIterators.NamespaceIterator, DTMDefaultBaseIterators.NthDescendantIterator, DTMDefaultBaseIterators.ParentIterator, DTMDefaultBaseIterators.PrecedingIterator, DTMDefaultBaseIterators.PrecedingSiblingIterator, DTMDefaultBaseIterators.RootIterator, DTMDefaultBaseIterators.SingletonIterator, DTMDefaultBaseIterators.TypedAncestorIterator, DTMDefaultBaseIterators.TypedAttributeIterator, DTMDefaultBaseIterators.TypedChildrenIterator, DTMDefaultBaseIterators.TypedDescendantIterator, DTMDefaultBaseIterators.TypedFollowingIterator, DTMDefaultBaseIterators.TypedFollowingSiblingIterator, DTMDefaultBaseIterators.TypedNamespaceIterator, DTMDefaultBaseIterators.TypedPrecedingIterator, DTMDefaultBaseIterators.TypedPrecedingSiblingIterator, DTMDefaultBaseIterators.TypedRootIterator, DTMDefaultBaseIterators.TypedSingletonIteratorDEFAULT_BLOCKSIZE, DEFAULT_NUMBLOCKS, DEFAULT_NUMBLOCKS_SMALL, m_mgr, ROOTNODEATTRIBUTE_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 and Description |
|---|
DTMDocument(DTMManager mgr,
int ident) |
| Modifier and Type | Method and Description |
|---|---|
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,
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,
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.
|
ContentHandler |
getContentHandler()
Return this DTM's content handler, if it has one.
|
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.
|
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. |
EntityResolver |
getEntityResolver()
Return this DTM's EntityResolver, if it has one.
|
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).
|
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.
|
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.
|
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
|
documentRegistration, documentRelease, dumpDTM, dumpNode, getDocumentRoot, getDTMIDs, getManager, getNodeHandle, getNodeIdent, getTypedFirstChild, getTypedNextSibling, makeNodeHandle, makeNodeIdentity, migrateTopublic DTMDocument(DTMManager mgr, int ident)
mgr - ident - public int getFirstAttribute(int parm1)
DTMDefaultBasegetFirstAttribute in interface DTMgetFirstAttribute in class DTMDefaultBaseparm1 - public java.lang.String getNodeValue(int parm1)
DTMDefaultBasegetNodeValue in interface DTMgetNodeValue in class DTMDefaultBaseparm1 - public XMLString getStringValue(int nodeHandle)
getStringValue in interface DTMgetStringValue in class DTMDefaultBasenodeHandle - The node ID.public int getNextAttribute(int parm1)
DTMDefaultBasegetNextAttribute in interface DTMgetNextAttribute in class DTMDefaultBaseparm1 - public void dumpDTM()
public void setProperty(java.lang.String property,
java.lang.Object value)
property - a String valuevalue - an Object valuepublic SourceLocator getSourceLocatorFor(int node)
null here.node - an int valuepublic int getAttributeNode(int parm1,
java.lang.String parm2,
java.lang.String parm3)
DTMDefaultBasegetAttributeNode in interface DTMgetAttributeNode in class DTMDefaultBaseparm1 - parm2 - parm3 - nodeName) or DTM.NULL if there is no such
attribute.public java.lang.String getLocalName(int parm1)
DTMDefaultBasegetLocalName in interface DTMgetLocalName in class DTMDefaultBaseparm1 - public java.lang.String getNodeName(int parm1)
DTMDefaultBasegetNodeName in interface DTMgetNodeName in class DTMDefaultBaseparm1 - public boolean isAttributeSpecified(int parm1)
DTMDefaultBaseisAttributeSpecified in interface DTMisAttributeSpecified in class DTMDefaultBaseparm1 - true if the attribute was specified;
false if it was defaulted.public java.lang.String getUnparsedEntityURI(java.lang.String parm1)
DTMDefaultBaseXML 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 DTMgetUnparsedEntityURI in class DTMDefaultBaseparm1 - public DTDHandler getDTDHandler()
DTMpublic 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 DTMgetPrefix in class DTMDefaultBaseparm1 - public EntityResolver getEntityResolver()
DTMpublic java.lang.String getDocumentTypeDeclarationPublicIdentifier()
DTMDefaultBasegetDocumentTypeDeclarationPublicIdentifier in interface DTMgetDocumentTypeDeclarationPublicIdentifier in class DTMDefaultBasepublic LexicalHandler getLexicalHandler()
DTMpublic boolean needsTwoThreads()
public ContentHandler getContentHandler()
DTMpublic void dispatchToEvents(int parm1,
ContentHandler parm2)
throws SAXException
DTMDefaultBasedispatchToEvents in interface DTMdispatchToEvents in class DTMDefaultBaseparm1 - parm2 - SAXExceptionpublic java.lang.String getNamespaceURI(int parm1)
DTMDefaultBase%REVIEW% Null or ""? -sb
getNamespaceURI in interface DTMgetNamespaceURI in class DTMDefaultBaseparm1 - public void dispatchCharactersEvents(int nodeHandle,
ContentHandler ch,
boolean normalize)
throws SAXException
DTMDefaultBasedispatchCharactersEvents in interface DTMdispatchCharactersEvents in class DTMDefaultBasenodeHandle - ch - normalize - SAXExceptionpublic boolean supportsPreStripping()
supportsPreStripping in interface DTMsupportsPreStripping in class DTMDefaultBasepublic Node getNode(int parm1)
DTMDefaultBasegetNode in interface DTMgetNode in class DTMDefaultBaseparm1 - public int getPreviousSibling(int parm1)
DTMDefaultBasegetPreviousSibling in interface DTMgetPreviousSibling in class DTMDefaultBaseparm1 - public java.lang.String getDocumentStandalone(int parm1)
DTMDefaultBasegetDocumentStandalone in interface DTMgetDocumentStandalone in class DTMDefaultBaseparm1 - public java.lang.String getNodeNameX(int parm1)
DTMDefaultBasegetNodeNameX in interface DTMgetNodeNameX in class DTMDefaultBaseparm1 - public void setFeature(java.lang.String parm1,
boolean parm2)
DTMDefaultBase%REVIEW% Do we really expect to set features on DTMs?
setFeature in interface DTMsetFeature in class DTMDefaultBaseparm1 - parm2 - public boolean isNodeAfter(int parm1,
int parm2)
DTMDefaultBaseThere 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 DTMisNodeAfter in class DTMDefaultBaseparm1 - parm2 - (node1.documentOrderPosition <= node2.documentOrderPosition).public int getNamespaceType(int parm1)
DTMDefaultBasegetNamespaceType in class DTMDefaultBaseparm1 - public java.lang.String getDocumentVersion(int parm1)
DTMDefaultBasegetDocumentVersion in interface DTMgetDocumentVersion in class DTMDefaultBaseparm1 - public boolean isSupported(java.lang.String parm1,
java.lang.String parm2)
DTMDefaultBaseisSupported in interface DTMisSupported in class DTMDefaultBaseparm1 - parm2 - true if the specified feature is
supported on this node, false otherwise.public java.lang.String getDocumentEncoding(int parm1)
DTMDefaultBasegetDocumentEncoding in interface DTMgetDocumentEncoding in class DTMDefaultBaseparm1 - 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 DTMappendChild in class DTMDefaultBaseparm1 - parm2 - parm3 - public short getLevel(int parm1)
DTMDefaultBasegetLevel in interface DTMgetLevel in class DTMDefaultBaseparm1 - public java.lang.String getDocumentBaseURI()
DTMDefaultBasegetDocumentBaseURI in interface DTMgetDocumentBaseURI in class DTMDefaultBasepublic int getNextNamespaceNode(int parm1,
int parm2,
boolean parm3)
DTMDefaultBasegetNextNamespaceNode in interface DTMgetNextNamespaceNode in class DTMDefaultBaseparm1 - 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 DTMappendTextChild in class DTMDefaultBaseparm1 - public int getFirstNamespaceNode(int parm1,
boolean parm2)
DTMDefaultBasegetFirstNamespaceNode in interface DTMgetFirstNamespaceNode in class DTMDefaultBaseparm1 - parm2 - public int getStringValueChunkCount(int parm1)
DTMDefaultBasegetStringValueChunkCount in interface DTMgetStringValueChunkCount in class DTMDefaultBaseparm1 - public int getLastChild(int parm1)
DTMDefaultBasegetLastChild in interface DTMgetLastChild in class DTMDefaultBaseparm1 - 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 DTMhasChildNodes in class DTMDefaultBaseparm1 - 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 DTMgetNodeType in class DTMDefaultBaseparm1 - public boolean isCharacterElementContentWhitespace(int parm1)
DTMDefaultBaseisCharacterElementContentWhitespace in interface DTMisCharacterElementContentWhitespace in class DTMDefaultBaseparm1 - true if the character data is whitespace;
false otherwise.public int getFirstChild(int parm1)
DTMDefaultBasegetFirstChild in interface DTMgetFirstChild in class DTMDefaultBaseparm1 - public java.lang.String getDocumentSystemIdentifier(int parm1)
DTMDefaultBasegetDocumentSystemIdentifier in interface DTMgetDocumentSystemIdentifier in class DTMDefaultBaseparm1 - public java.lang.String getNamespaceFromExpandedNameID(int parm1)
DTMDefaultBasegetNamespaceFromExpandedNameID in interface DTMgetNamespaceFromExpandedNameID in class DTMDefaultBaseparm1 - public java.lang.String getLocalNameFromExpandedNameID(int parm1)
DTMDefaultBasegetLocalNameFromExpandedNameID in interface DTMgetLocalNameFromExpandedNameID in class DTMDefaultBaseparm1 - public int getExpandedTypeID(int parm1)
DTMDefaultBasegetExpandedTypeID in interface DTMgetExpandedTypeID in class DTMDefaultBaseparm1 - public int getDocument()
DTMDefaultBasegetDocument in interface DTMgetDocument in class DTMDefaultBasepublic boolean isDocumentAllDeclarationsProcessed(int parm1)
DTMDefaultBaseisDocumentAllDeclarationsProcessed in interface DTMisDocumentAllDeclarationsProcessed in class DTMDefaultBaseparm1 - 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 DTMgetOwnerDocument in class DTMDefaultBaseparm1 - DTM.getDocumentRoot(int nodeHandle)public int getNextSibling(int parm1)
DTMDefaultBasegetNextSibling in interface DTMgetNextSibling in class DTMDefaultBaseparm1 - public boolean getDocumentAllDeclarationsProcessed()
DTMDefaultBasegetDocumentAllDeclarationsProcessed in interface DTMgetDocumentAllDeclarationsProcessed in class DTMDefaultBasetrue if all declarations were processed;
false otherwise.public int getParent(int parm1)
DTMDefaultBasegetParent in interface DTMgetParent in class DTMDefaultBaseparm1 - public int getExpandedTypeID(java.lang.String parm1,
java.lang.String parm2,
int parm3)
DTMDefaultBasegetExpandedTypeID in interface DTMgetExpandedTypeID in class DTMDefaultBaseparm1 - parm2 - parm3 - public void setDocumentBaseURI(java.lang.String parm1)
DTMDefaultBasesetDocumentBaseURI in interface DTMsetDocumentBaseURI in class DTMDefaultBaseparm1 - public char[] getStringValueChunk(int parm1,
int parm2,
int[] parm3)
DTMDefaultBasegetStringValueChunk in interface DTMgetStringValueChunk in class DTMDefaultBaseparm1 - parm2 - parm3 - public DTMAxisTraverser getAxisTraverser(int parm1)
DTMDefaultBaseTraversersgetAxisTraverser in interface DTMgetAxisTraverser in class DTMDefaultBaseTraversersparm1 - public DTMAxisIterator getTypedAxisIterator(int parm1, int parm2)
DTMDefaultBaseIteratorsgetTypedAxisIterator in interface DTMgetTypedAxisIterator in class DTMDefaultBaseIteratorsparm1 - parm2 - public DTMAxisIterator getAxisIterator(int parm1)
DTMDefaultBaseIteratorsgetAxisIterator in interface DTMgetAxisIterator in class DTMDefaultBaseIteratorsparm1 - public int getElementById(java.lang.String parm1)
DTMDefaultBaseElement 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 DTMgetElementById in class DTMDefaultBaseparm1 - public DeclHandler getDeclHandler()
DTMpublic ErrorHandler getErrorHandler()
DTMpublic java.lang.String getDocumentTypeDeclarationSystemIdentifier()
DTMDefaultBasegetDocumentTypeDeclarationSystemIdentifier in interface DTMgetDocumentTypeDeclarationSystemIdentifier in class DTMDefaultBaseCopyright © 2014 Apache XML Project. All Rights Reserved.