org.apache.xalan.xpath.dtm
Class DTM

java.lang.Object
  |
  +--org.apache.xerces.framework.XMLParser
        |
        +--org.apache.xalan.xpath.dtm.DTM

public class DTM
extends org.apache.xerces.framework.XMLParser
implements java.lang.Runnable

**For internal use only** DTM is an XML document model expressed as a table rather than an object tree. It attempts to be very compact, and to support very specifically limited multitasking: users can start reading the document while it's still being generated. (A work in progress...)

(***** The SAX handler calls, and the string-based XMLDocumentHandler methods, are known to be bad; they're included as hooks for the future.)

DTM does _not_ directly support the W3C's Document Object Model. However, it attempts to come close enough that a subset of DOM behavior can be implemented as proxy objects referencing the DTM.

See Also:
DTMProxy

Field Summary
static java.lang.String DEFAULT_PREFIX_STR
          **For internal use only**  
 
Constructor Summary
DTM()
          **For internal use only** Construct a DTM.
DTM(ProblemListener listener)
          **For internal use only** Construct a DTM.
 
Method Summary
 void attlistDecl(int elementTypeIndex, int attrNameIndex, int attType, java.lang.String enumString, int attDefaultType, int attDefaultValue)
          **For internal use only** <!ATTLIST Name AttDef>
 void characters(char[] ch, int start, int length)
          **For internal use only** SAX API: Accept a chunk of characters for normalization into a Text node.
 void characters(char[] ch, int start, int length, boolean cdataSection)
          **For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into a Text node.
 void characters(int dataIndex)
          **For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into a Text node.
 void comment(int dataIndex)
          **For internal use only** XMLDocumentHandler API: Create a Comment node.
 void display(int position)
          **For internal use only** DTM development API: Given a node index, write the node's contents in extremely terse form onto Standard Output.
 void dump()
          **For internal use only** DTM development API: display() all the nodes in the DTM.
 void dumpDTM()
          **For internal use only**  
 void elementDecl(int elementTypeIndex, org.apache.xerces.framework.XMLValidator.ContentSpec contentModel)
          **For internal use only** <!ELEMENT Name contentspec>
 void endCDATA()
          **For internal use only** End CDATA section.
 void endDocument()
          **For internal use only** SAX API: End of Document reached.
 void endDTD()
          **For internal use only** This function will be called at the end of the DTD.
 void endElement(int name)
          **For internal use only** XMLDocumentHandler API: End-tag reached.
 void endEntityReference(int entityName, int entityType, int entityContext)
          **For internal use only** End entity reference.
 void endNamespaceDeclScope(int prefix)
          **For internal use only** Report the end of the scope of a namespace declaration.
 void externalEntityDecl(int entityName, int publicId, int systemId)
          **For internal use only** <!ENTITY Name ExternalID> (external)
 void externalPEDecl(int entityName, int publicId, int systemId)
          **For internal use only** <!ENTITY % Name ExternalID> (external)
 void general_characters(int index)
          **For internal use only** Text-accumulator operation for the integer-index version of characters().
 boolean getCreateEntityReferenceNodes()
          **For internal use only**  
 org.w3c.dom.Document getDocument()
          **For internal use only** Return the document proxy object.
 int getFirstAttribute(int position)
          **For internal use only** DTM read API: Given a node index, get the index of the node's first child.
 int getFirstChild(int position)
          **For internal use only** DTM read API: Given a node index, get the index of the node's first child.
 org.w3c.dom.Element getIdentifier(java.lang.String id)
          **For internal use only** Get the element identified by the ID.
 int getLastChild(int position)
          **For internal use only** DTM read API: Given a node index, advance to its last child.
 java.lang.String getLocalName(int position)
          **For internal use only** DTM read API: Given a node index, return its DOM-style localname.
 java.lang.String getNamespaceURI(int position)
          **For internal use only** DTM read API: Given a node index, 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 position)
          **For internal use only** DTM read API: Given a node index, advance to the next attribute.
 int getNextDescendant(int parentPos, int position)
          **For internal use only** DTM read API: Given a node index, advance to its next descendant.
 int getNextNode(int parentPos, int position)
          **For internal use only** DTM read API: Given a node index, advance to its next sibling.
 int getNextPreceding(int startPos, int position)
          **For internal use only** DTM read API: Given a node index, advance to the preceding node.
 int getNextSibling(int position)
          **For internal use only** DTM read API: Given a node index, advance to its next sibling.
 DTMProxy getNode(int pos)
          **For internal use only** Return a Node object that represents the index.
 java.lang.String getNodeName(int position)
          **For internal use only** DTM read API: Given a node index, return its DOM-style node name.
 int getNodeType(int position)
          **For internal use only** DTM read API: Given a node index, return its DOM-style node type.
 java.lang.String getNodeValue(int position)
          **For internal use only** DTM read API: Given a node index, return its node value.
 int getParent(int position)
          **For internal use only** DTM read API: Given a node index, find its parent node.
 int getPrecedingOrAncestorOrSelf(int position)
          **For internal use only** DTM read API: Given a node index, advance to the preceding node.
 java.lang.String getPrefix(int position)
          **For internal use only** DTM read API: Given a node index, return its DOM-style name prefix.
 int getPreviousSibling(int position)
          **For internal use only** DTM read API: Given a node index, find its preceeding sibling.
 org.apache.xerces.utils.StringPool getStringPool()
          **For internal use only** Make the string public.
 void ignorableWhitespace(char[] ch, int start, int length)
          **For internal use only** SAX API: Accept a chunk of characters for normalization into an ignorable-whitespace Text node.
 void ignorableWhitespace(char[] ch, int start, int length, boolean cdataSection)
          **For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into an ignorable-whitespace Text node.
 void ignorableWhitespace(int dataIndex)
          **For internal use only** Ignorable whitespace.
 void ignorableWhitespace(int dataIndex, boolean cdataSection)
          **For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into an ignorable-whitespace Text node.
 void internalEntityDecl(int entityName, int entityValue)
          **For internal use only** <!ENTITY Name EntityValue> (internal)
 void internalPEDecl(int entityName, int entityValue)
          **For internal use only** <!ENTITY % Name EntityValue> (internal)
 void internalSubset(int internalSubset)
          **For internal use only** Report when the internal subset is completely scanned.
 boolean isIgnorableText(int position)
          **For internal use only** DTM read API: Given a node index, indicate whether the parser marked it as an ignorable-whitespace text node.
 void notationDecl(int notationName, int publicId, int systemId)
          **For internal use only** <!NOTATION Name ExternalId>
 void processingInstruction(int target, int data)
          **For internal use only** XMLDocumentHandler API: Create a PI node.
 void run()
          **For internal use only** Run the parse thread.
 void setFeature(java.lang.String featureId, boolean state)
          **For internal use only** Set the state of any feature in a SAX2 parser.
 void setInputSource(org.xml.sax.InputSource inputSource)
          **For internal use only**  
 void setProblemListener(ProblemListener listener)
          **For internal use only** Set the current problem listener.
 void startCDATA()
          **For internal use only** Start CDATA section.
 void startDocument(int versionIndex, int encodingIndex, int standAloneIndex)
          **For internal use only** XMLDocumentHandler API: Start-of-document recieved.
 void startDTD(int rootElementType, int publicId, int systemId)
          **For internal use only** This function will be called when a <!DOCTYPE...> declaration is encountered.
 void startElement(int elementNameIndex, org.apache.xerces.framework.XMLAttrList xmlAttrList, int attrListIndex)
          **For internal use only** XMLDocumentHandler API: Process element start-tag and its attributes.
 void startEntityReference(int entityName, int entityType, int entityContext)
          **For internal use only** Start entity reference.
 void startNamespaceDeclScope(int prefix, int uri)
          **For internal use only** Report the start of the scope of a namespace declaration.
 void unparsedEntityDecl(int entityName, int publicId, int systemId, int notationName)
          **For internal use only** <!ENTITY Name ExternalID NDataDecl> (unparsed)
 
Methods inherited from class org.apache.xerces.framework.XMLParser
addRecognizer, callCharacters, callComment, callEndDocument, callEndElement, callProcessingInstruction, callStartDocument, callStartElement, changeReaders, commentInDTD, endEntityDecl, expandSystemId, getColumnNumber, getEntityReader, getEntityResolver, getErrorHandler, getFeature, getFeaturesRecognized, getLineNumber, getLocator, getPropertiesRecognized, getProperty, getPublicId, getReaderDepth, getReaderId, getSystemId, isFeatureRecognized, isPropertyRecognized, parse, parse, parseSome, parseSomeSetup, processCharacters, processCharacters, processingInstructionInDTD, processWhitespace, processWhitespace, reportError, reset, scanAttributeName, scanAttValue, scanDoctypeDecl, scanElementType, scanExpectedElementType, setEntityResolver, setErrorHandler, setLocale, setLocator, setProperty, setReaderDepth, setReaderFactory, setValidating, startEntityDecl, startReadingFromDocument, startReadingFromEntity, startReadingFromExternalSubset, stopReadingFromExternalSubset, validEncName, validVersionNum
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PREFIX_STR

public static final java.lang.String DEFAULT_PREFIX_STR
Constructor Detail

DTM

public DTM()
**For internal use only** Construct a DTM. This is the only constructor currently working.
Parameters:
parser - HookedXMLParser Input event-stream source.

DTM

public DTM(ProblemListener listener)
**For internal use only** Construct a DTM. This is the only constructor currently working.
Parameters:
parser - HookedXMLParser Input event-stream source.
Method Detail

getStringPool

public org.apache.xerces.utils.StringPool getStringPool()
**For internal use only** Make the string public.

setInputSource

public void setInputSource(org.xml.sax.InputSource inputSource)

setProblemListener

public void setProblemListener(ProblemListener listener)
**For internal use only** Set the current problem listener.

run

public void run()
**For internal use only** Run the parse thread.
Specified by:
run in interface java.lang.Runnable

getNode

public final DTMProxy getNode(int pos)
**For internal use only** Return a Node object that represents the index.

startDocument

public final void startDocument(int versionIndex,
                                int encodingIndex,
                                int standAloneIndex)
**For internal use only** XMLDocumentHandler API: Start-of-document recieved. Much like the SAX startDocument() and setDocumentLocator() calls, but also has the side effect of switching DTM into its XML4J-aware mode.
Overrides:
startDocument in class org.apache.xerces.framework.XMLParser

endDocument

public final void endDocument()
                       throws org.xml.sax.SAXException
**For internal use only** SAX API: End of Document reached. Finalize the DTM: close out the sibling chain, mark the document as no-more-nodes-expected, and wake up anyone who is waiting.
Throws:
org.xml.sax.SAXException - Not used.
Overrides:
endDocument in class org.apache.xerces.framework.XMLParser

startElement

public final void startElement(int elementNameIndex,
                               org.apache.xerces.framework.XMLAttrList xmlAttrList,
                               int attrListIndex)
**For internal use only** XMLDocumentHandler API: Process element start-tag and its attributes. This includes pushing a new namespace context (with any namespaces declared on this element), creating the Element node, making it the new parent, and creating child Attribute nodes as needed. Namespace declarations _do_ appear as attributes. Attributes are expressed as the leading children of the Element, and are separated out later, which is different from DOM's behavior.

The mapping from namespace prefixes to namespace URIs is also performed at this time.

Parameters:
elementNameIndex - int Index of element's qualified name in symbol table.
attrListIndex - int Starting index of this element's attributes in the parser's attribute table, or -1 to indicate no attributes.
Overrides:
startElement in class org.apache.xerces.framework.XMLParser

endElement

public final void endElement(int name)
**For internal use only** XMLDocumentHandler API: End-tag reached. Pop the parentage context, along with any namespaces this element defined. Make sure that the sibling chain has been properly terminated.
Parameters:
name - int Index of element name in XML4J's symbol table
Overrides:
endElement in class org.apache.xerces.framework.XMLParser

characters

public final void characters(char[] ch,
                             int start,
                             int length)
                      throws org.xml.sax.SAXException
**For internal use only** SAX API: Accept a chunk of characters for normalization into a Text node. Note that since SAX may reuse its input buffers, we may need to either extract the string now or cache a copy of the buffer. It is unclear which approach is preferable
Parameters:
ch - char[] Input buffer in which string can be found.
start - int Offset to start of string, 0-based.
length - int Length of string
Throws:
org.xml.sax.SAXException - Required by API, not thrown as far as I know.
Overrides:
characters in class org.apache.xerces.framework.XMLParser

characters

public final void characters(char[] ch,
                             int start,
                             int length,
                             boolean cdataSection)
                      throws org.xml.sax.SAXException
**For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into a Text node. This is an "enhanced SAX" flavor of the call, adding the flag for CDATA sections, and is not currently used.

Note that since XML4J may reuse its input buffers, we may need to either extract the string now or cache a copy of the buffer. It is unclear which approach is preferable

Parameters:
ch - char[] Input buffer in which string can be found.
start - int Offset to start of string, 0-based.
length - int Length of string
cdataSection - boolean True iff text was enclosed in
Throws:
org.xml.sax.SAXException - Required by API, not thrown as far as I know.

characters

public final void characters(int dataIndex)
                      throws org.xml.sax.SAXException
**For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into a Text node. This is the "late binding" version of the call, which we currently rely upon.
Parameters:
dataIndex - int Index of this string in XML4J's symbol tables
cdataSection - boolean True iff text was enclosed in
Throws:
org.xml.sax.SAXException - Required by API, not thrown as far as I know.
Overrides:
characters in class org.apache.xerces.framework.XMLParser

startCDATA

public final void startCDATA()
                      throws java.lang.Exception
**For internal use only** Start CDATA section.
Overrides:
startCDATA in class org.apache.xerces.framework.XMLParser

endCDATA

public final void endCDATA()
                    throws java.lang.Exception
**For internal use only** End CDATA section.
Overrides:
endCDATA in class org.apache.xerces.framework.XMLParser

ignorableWhitespace

public final void ignorableWhitespace(int dataIndex)
                               throws java.lang.Exception
**For internal use only** Ignorable whitespace.
Overrides:
ignorableWhitespace in class org.apache.xerces.framework.XMLParser

ignorableWhitespace

public final void ignorableWhitespace(char[] ch,
                                      int start,
                                      int length)
                               throws org.xml.sax.SAXException
**For internal use only** SAX API: Accept a chunk of characters for normalization into an ignorable-whitespace Text node. Note that since SAX may reuse its input buffers, we may need to either extract the string now or cache a copy of the buffer. It is unclear which approach is preferable
Parameters:
ch - char[] Input buffer in which string can be found.
start - int Offset to start of string, 0-based.
length - int Length of string
Throws:
org.xml.sax.SAXException - Required by API, not thrown as far as I know.
Overrides:
ignorableWhitespace in class org.apache.xerces.framework.XMLParser

ignorableWhitespace

public final void ignorableWhitespace(char[] ch,
                                      int start,
                                      int length,
                                      boolean cdataSection)
                               throws org.xml.sax.SAXException
**For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into an ignorable-whitespace Text node. This is an "enhanced SAX" flavor of the call, adding the flag for CDATA sections, and is not currently used.

Note that since XML4J may reuse its input buffers, we may need to either extract the string now or cache a copy of the buffer. It is unclear which approach is preferable

Parameters:
ch - char[] Input buffer in which string can be found.
start - int Offset to start of string, 0-based.
length - int Length of string
cdataSection - boolean True iff text was enclosed in
Throws:
org.xml.sax.SAXException - Required by API, not thrown as far as I know.

ignorableWhitespace

public final void ignorableWhitespace(int dataIndex,
                                      boolean cdataSection)
                               throws org.xml.sax.SAXException
**For internal use only** XMLDocumentHandler API: Accept a chunk of characters for normalization into an ignorable-whitespace Text node. This is the "late binding" version of the call, which we currently rely upon.
Parameters:
dataIndex - int Index of this string in XML4J's symbol tables
cdataSection - boolean True iff text was enclosed in
Throws:
org.xml.sax.SAXException - Required by API, not thrown as far as I know.

general_characters

public final void general_characters(int index)
**For internal use only** Text-accumulator operation for the integer-index version of characters(). Obviously far simpler, since we are assured that (unlike the parse buffers) the XML4J symbol table will persist.
Parameters:
index - int Index of this string in XML4J's symbol tables.

KNOWN LIMITATION: DOESN'T PRESERVE CDATA FLAG.


comment

public final void comment(int dataIndex)
**For internal use only** XMLDocumentHandler API: Create a Comment node. Available only in the late-binding form, and not supported in SAX 1.0 at all.
Parameters:
dataIndex - int Index of comment's contents in XML4J's symbol table
Overrides:
comment in class org.apache.xerces.framework.XMLParser

processingInstruction

public final void processingInstruction(int target,
                                        int data)
**For internal use only** XMLDocumentHandler API: Create a PI node.
Parameters:
target - int target processor name index
data - int Index of PI parameters to be passed to that processor
Overrides:
processingInstruction in class org.apache.xerces.framework.XMLParser

startNamespaceDeclScope

public final void startNamespaceDeclScope(int prefix,
                                          int uri)
                                   throws java.lang.Exception
**For internal use only** Report the start of the scope of a namespace declaration.
Overrides:
startNamespaceDeclScope in class org.apache.xerces.framework.XMLParser

endNamespaceDeclScope

public final void endNamespaceDeclScope(int prefix)
                                 throws java.lang.Exception
**For internal use only** Report the end of the scope of a namespace declaration.
Overrides:
endNamespaceDeclScope in class org.apache.xerces.framework.XMLParser

internalSubset

public final void internalSubset(int internalSubset)
**For internal use only** Report when the internal subset is completely scanned.
Overrides:
internalSubset in class org.apache.xerces.framework.XMLParser

startEntityReference

public final void startEntityReference(int entityName,
                                       int entityType,
                                       int entityContext)
                                throws java.lang.Exception
**For internal use only** Start entity reference.
Overrides:
startEntityReference in class org.apache.xerces.framework.XMLParser

endEntityReference

public final void endEntityReference(int entityName,
                                     int entityType,
                                     int entityContext)
                              throws java.lang.Exception
**For internal use only** End entity reference.
Overrides:
endEntityReference in class org.apache.xerces.framework.XMLParser

setFeature

public void setFeature(java.lang.String featureId,
                       boolean state)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
**For internal use only** Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.
Parameters:
featureId - The unique identifier (URI) of the feature.
state - The requested state of the feature (true or false).
Throws:
org.xml.sax.SAXNotRecognizedException - If the requested feature is not known.
org.xml.sax.SAXNotSupportedException - If the requested feature is known, but the requested state is not supported.
org.xml.sax.SAXException - If there is any other problem fulfilling the request.
Overrides:
setFeature in class org.apache.xerces.framework.XMLParser

startDTD

public final void startDTD(int rootElementType,
                           int publicId,
                           int systemId)
                    throws java.lang.Exception
**For internal use only** This function will be called when a <!DOCTYPE...> declaration is encountered.
Overrides:
startDTD in class org.apache.xerces.framework.XMLParser

endDTD

public final void endDTD()
                  throws java.lang.Exception
**For internal use only** This function will be called at the end of the DTD.
Overrides:
endDTD in class org.apache.xerces.framework.XMLParser

elementDecl

public final void elementDecl(int elementTypeIndex,
                              org.apache.xerces.framework.XMLValidator.ContentSpec contentModel)
                       throws java.lang.Exception
**For internal use only** <!ELEMENT Name contentspec>
Overrides:
elementDecl in class org.apache.xerces.framework.XMLParser

attlistDecl

public final void attlistDecl(int elementTypeIndex,
                              int attrNameIndex,
                              int attType,
                              java.lang.String enumString,
                              int attDefaultType,
                              int attDefaultValue)
                       throws java.lang.Exception
**For internal use only** <!ATTLIST Name AttDef>
Overrides:
attlistDecl in class org.apache.xerces.framework.XMLParser

getIdentifier

public final org.w3c.dom.Element getIdentifier(java.lang.String id)
**For internal use only** Get the element identified by the ID.

internalPEDecl

public final void internalPEDecl(int entityName,
                                 int entityValue)
                          throws java.lang.Exception
**For internal use only** <!ENTITY % Name EntityValue> (internal)
Overrides:
internalPEDecl in class org.apache.xerces.framework.XMLParser

externalPEDecl

public final void externalPEDecl(int entityName,
                                 int publicId,
                                 int systemId)
                          throws java.lang.Exception
**For internal use only** <!ENTITY % Name ExternalID> (external)
Overrides:
externalPEDecl in class org.apache.xerces.framework.XMLParser

internalEntityDecl

public final void internalEntityDecl(int entityName,
                                     int entityValue)
                              throws java.lang.Exception
**For internal use only** <!ENTITY Name EntityValue> (internal)
Overrides:
internalEntityDecl in class org.apache.xerces.framework.XMLParser

externalEntityDecl

public final void externalEntityDecl(int entityName,
                                     int publicId,
                                     int systemId)
                              throws java.lang.Exception
**For internal use only** <!ENTITY Name ExternalID> (external)
Overrides:
externalEntityDecl in class org.apache.xerces.framework.XMLParser

unparsedEntityDecl

public final void unparsedEntityDecl(int entityName,
                                     int publicId,
                                     int systemId,
                                     int notationName)
                              throws java.lang.Exception
**For internal use only** <!ENTITY Name ExternalID NDataDecl> (unparsed)
Overrides:
unparsedEntityDecl in class org.apache.xerces.framework.XMLParser

notationDecl

public final void notationDecl(int notationName,
                               int publicId,
                               int systemId)
                        throws java.lang.Exception
**For internal use only** <!NOTATION Name ExternalId>
Overrides:
notationDecl in class org.apache.xerces.framework.XMLParser

getDocument

public final org.w3c.dom.Document getDocument()
**For internal use only** Return the document proxy object.

getFirstChild

public final int getFirstChild(int position)
**For internal use only** DTM read API: Given a node index, get the index of the node's first child. If not yet resolved, waits for more nodes to be added to the document and tries again
Parameters:
postition - int Index of this node's record.
Returns:
int DTM node-number of first child, or -1 to indicate none exists.

getFirstAttribute

public final int getFirstAttribute(int position)
**For internal use only** DTM read API: Given a node index, get the index of the node's first child. If not yet resolved, waits for more nodes to be added to the document and tries again
Parameters:
postition - int Index of this node's record.
Returns:
int DTM node-number of first child, or -1 to indicate none exists.

getNextAttribute

public final int getNextAttribute(int position)
**For internal use only** DTM read API: Given a node index, advance to the next attribute. If an element, we advance to its first attribute; if an attr, we advance to the next attr on the same node. If not yet resolved, waits for more nodes to be added to the document and tries again.
Parameters:
postition - int Index of this node's record.
Returns:
int DTM node-number of the resolved attr, or -1 to indicate none exists.

getLastChild

public final int getLastChild(int position)
**For internal use only** DTM read API: Given a node index, advance to its last child. If not yet resolved, waits for more nodes to be added to the document and tries again. WARNING: DTM is asymmetric; this operation is resolved by search, and is relatively expensive.
Parameters:
postition - int Index of this node's record.
Returns:
int Node-number of last child, or -1 to indicate none exists.

getNextSibling

public final int getNextSibling(int position)
**For internal use only** DTM read API: Given a node index, advance to its next sibling. If not yet resolved, waits for more nodes to be added to the document and tries again.
Parameters:
postition - int Index of this node's record.
Returns:
int Node-number of next sibling, or -1 to indicate none exists.

getNextDescendant

public final int getNextDescendant(int parentPos,
                                   int position)
**For internal use only** DTM read API: Given a node index, advance to its next descendant. If not yet resolved, waits for more nodes to be added to the document and tries again.
Parameters:
postition - int Index of this node's record.
Returns:
int Node-number of next descendant, or -1 to indicate none exists.

getNextNode

public final int getNextNode(int parentPos,
                             int position)
**For internal use only** DTM read API: Given a node index, advance to its next sibling. If not yet resolved, waits for more nodes to be added to the document and tries again.
Parameters:
postition - int Index of this node's record.
Returns:
int Node-number of next sibling, or -1 to indicate none exists.

getParent

public final int getParent(int position)
**For internal use only** DTM read API: Given a node index, find its parent node.
Parameters:
postition - int Index of this node's record.
Returns:
int Node-number of parent, or -1 to indicate none exists.

getPreviousSibling

public final int getPreviousSibling(int position)
**For internal use only** DTM read API: Given a node index, find its preceeding sibling. WARNING: DTM is asymmetric; this operation is resolved by search, and is relatively expensive.
Parameters:
postition - int Index of this node's record.
Returns:
int Node-number of the previous sib, or -1 to indicate none exists.

getNextPreceding

public final int getNextPreceding(int startPos,
                                  int position)
**For internal use only** DTM read API: Given a node index, advance to the preceding node. The preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes.
Parameters:
startPos - The position from where the axes is relative to.
postition - int Index of this node's record.
Returns:
int Node-number of preceding sibling, or -1 to indicate none exists.

getPrecedingOrAncestorOrSelf

public final int getPrecedingOrAncestorOrSelf(int position)
**For internal use only** DTM read API: Given a node index, advance to the preceding node. The preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes.
Parameters:
startPos - The position from where the axes is relative to.
postition - int Index of this node's record.
Returns:
int Node-number of preceding sibling, or -1 to indicate none exists.

getNodeName

public final java.lang.String getNodeName(int position)
**For internal use only** DTM read API: Given a node index, return its DOM-style node name.
Parameters:
postition - int Index of this node's record.
Returns:
String Name of this node.

getLocalName

public final java.lang.String getLocalName(int position)
**For internal use only** DTM read API: Given a node index, return its DOM-style localname. (As defined in Namespaces, this is the portion of the name after any colon character)
Parameters:
postition - int Index of this node's record.
Returns:
String Local name of this node.

getPrefix

public final java.lang.String getPrefix(int position)
**For internal use only** DTM read API: Given a node index, return its DOM-style name prefix. (As defined in Namespaces, this is the portion of the name before any colon character)
Parameters:
postition - int Index of this node's record.
Returns:
String prefix of this node's name, or null if no explicit namespace prefix was given.

getNamespaceURI

public final java.lang.String getNamespaceURI(int position)
**For internal use only** DTM read API: Given a node index, 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.)
Parameters:
postition - int Index of this node's record.
Returns:
String URI value of this node's namespace, or null if no namespace was resolved.

getNodeValue

public final java.lang.String getNodeValue(int position)
**For internal use only** DTM read API: Given a node index, return its node value. This is mostly as defined by the DOM, but may ignore some conveniences.

Parameters:
postition - int Index of this node's record.
Returns:
String Value of this node, or null if not meaningful for this node type.

getNodeType

public final int getNodeType(int position)
**For internal use only** DTM read API: Given a node index, return its DOM-style node type.
Parameters:
postition - int Index of this node's record.
Returns:
int Node type, as per the DOM's Node._NODE constants.

isIgnorableText

public final boolean isIgnorableText(int position)
**For internal use only** DTM read API: Given a node index, indicate whether the parser marked it as an ignorable-whitespace text node.
Parameters:
postition - int Index of this node's record.
Returns:
boolean true iff the node was created via an ignorableWhitespace event.

display

public final void display(int position)
**For internal use only** DTM development API: Given a node index, write the node's contents in extremely terse form onto Standard Output.
Parameters:
postition - int Index of this node's record.

dump

public final void dump()
**For internal use only** DTM development API: display() all the nodes in the DTM.
See Also:
display

getCreateEntityReferenceNodes

public final boolean getCreateEntityReferenceNodes()
See Also:
#setCreateEntityReferenceNodes

dumpDTM

public void dumpDTM()