Class SAX2DTM2
- All Implemented Interfaces:
DTM,ContentHandler,DTDHandler,EntityResolver,ErrorHandler,DeclHandler,LexicalHandler
public class SAX2DTM2 extends SAX2DTM
Performance is the biggest consideration in the design of SAX2DTM2. To make the code most efficient, the incremental support is dropped in SAX2DTM2, which means that you should not use it in incremental situation. To reduce the overhead of pulling data from the DTM model, a few core interfaces in SAX2DTM2 have direct access to the internal arrays of the SuballocatedIntVectors.
The design of SAX2DTM2 may limit its extensibilty. If you have a reason to extend the SAX2DTM model, please extend from SAX2DTM instead of this class.
TODO: This class is currently only used by XSLTC. We need to investigate the possibility of also using it in Xalan-J Interpretive. Xalan's performance is likely to get an instant boost if we use SAX2DTM2 instead of SAX2DTM in non-incremental case.
%MK% The code in this class is critical to the XSLTC_DTM performance. Be very careful when making changes here!
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSAX2DTM2.AncestorIteratorIterator that returns the ancestors of a given node in document order.classSAX2DTM2.AttributeIteratorIterator that returns attribute nodes (of what nodes?)classSAX2DTM2.ChildrenIteratorIterator that returns all immediate children of a given nodeclassSAX2DTM2.DescendantIteratorIterator that returns the descendants of a given node.classSAX2DTM2.FollowingIteratorIterator that returns following nodes of for a given node.classSAX2DTM2.FollowingSiblingIteratorIterator that returns all siblings of a given node.classSAX2DTM2.ParentIteratorIterator that returns the parent of a given node.classSAX2DTM2.PrecedingIteratorIterator that returns preceding nodes of a given node.classSAX2DTM2.PrecedingSiblingIteratorIterator that returns preceding siblings of a given nodeclassSAX2DTM2.TypedAncestorIteratorTyped iterator that returns the ancestors of a given node.classSAX2DTM2.TypedAttributeIteratorIterator that returns attribute nodes of a given typeclassSAX2DTM2.TypedChildrenIteratorIterator that returns children of a given type for a given node.classSAX2DTM2.TypedDescendantIteratorTyped iterator that returns the descendants of a given node.classSAX2DTM2.TypedFollowingIteratorIterator that returns following nodes of a given type for a given node.classSAX2DTM2.TypedFollowingSiblingIteratorIterator that returns all following siblings of a given node.classSAX2DTM2.TypedPrecedingIteratorIterator that returns preceding nodes of agiven type for a given node.classSAX2DTM2.TypedPrecedingSiblingIteratorIterator that returns preceding siblings of a given type for a given nodeclassSAX2DTM2.TypedRootIteratorIterator that returns the namespace nodes as defined by the XPath data model for a given node, filtered by extended type ID.classSAX2DTM2.TypedSingletonIteratorIterator that returns a given node only if it is of a given type.Nested classes/interfaces inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseIterators
DTMDefaultBaseIterators.InternalAxisIteratorBase, DTMDefaultBaseIterators.NamespaceAttributeIterator, DTMDefaultBaseIterators.NamespaceChildrenIterator, DTMDefaultBaseIterators.NamespaceIterator, DTMDefaultBaseIterators.NthDescendantIterator, DTMDefaultBaseIterators.RootIterator, DTMDefaultBaseIterators.SingletonIterator, DTMDefaultBaseIterators.TypedNamespaceIterator -
Field Summary
Fields Modifier and Type Field Description protected intm_blocksizeprotected booleanm_buildIdIndexprotected ExtendedType[]m_extendedTypesprotected intm_MASKprotected intm_SHIFTprotected Vectorm_valuesprotected static intTEXT_LENGTH_BITS%OPT% If the offset and length of a Text node are within certain limits, we store a bitwise encoded value into an int, using 10 bits (max.protected static intTEXT_LENGTH_MAXprotected static intTEXT_OFFSET_BITSprotected static intTEXT_OFFSET_MAXFields inherited from class org.apache.xml.dtm.ref.sax2dtm.SAX2DTM
m_chars, m_coalescedTextType, m_contextIndexes, m_data, m_dataOrQName, m_endDocumentOccured, m_idAttributes, m_insideDTD, m_locator, m_parents, m_prefixMappings, m_previous, m_sourceColumn, m_sourceLine, m_sourceSystemId, m_textPendingStart, m_textType, m_useSourceLocationProperty, m_valuesOrPrefixes, m_walkerFields inherited from class org.apache.xml.dtm.ref.DTMDefaultBase
DEFAULT_BLOCKSIZE, DEFAULT_NUMBLOCKS, DEFAULT_NUMBLOCKS_SMALL, m_documentBaseURI, m_dtmIdent, m_elemIndexes, m_expandedNameTable, m_exptype, m_firstch, m_indexing, m_mgr, m_mgrDefault, m_namespaceDeclSetElements, m_namespaceDeclSets, m_nextsib, m_parent, m_prevsib, m_shouldStripWhitespaceStack, m_shouldStripWS, m_size, m_traversers, m_wsfilter, m_xstrf, NOTPROCESSED, ROOTNODEFields 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
Constructors Constructor Description SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing)Construct a SAX2DTM2 object using the default block size.SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, int blocksize, boolean usePrevsib, boolean buildIdIndex, boolean newNameTable)Construct a SAX2DTM2 object using the given block size. -
Method Summary
Modifier and Type Method Description int_exptype(int identity)Override DTMDefaultBase._exptype() by dropping the incremental code.int_exptype2(int identity)The optimized version of DTMDefaultBase._exptype().int_exptype2Type(int exptype)Return the node type from the expanded typeint_firstch2(int identity)The optimized version of DTMDefaultBase._firstch().int_nextsib2(int identity)The optimized version of DTMDefaultBase._nextsib().int_parent2(int identity)The optimized version of DTMDefaultBase._parent().int_type2(int identity)The optimized version of DTMDefaultBase._type().protected intaddNode(int type, int expandedTypeID, int parentIndex, int previousSibling, int dataOrPrefix, boolean canHaveFirstChild)Construct the node map from the node.protected voidcharactersFlush()Check whether accumulated text should be stripped; if not, append the appropriate flavor of text/cdata node.voidcomment(char[] ch, int start, int length)Report an XML comment anywhere in the document.protected voidcopyAttribute(int nodeID, int exptype, SerializationHandler handler)Copy an Attribute node to a SerializationHandlerprotected voidcopyAttributes(int nodeID, SerializationHandler handler)Copy attribute nodes from an element .protected StringcopyElement(int nodeID, int exptype, SerializationHandler handler)Copy an Element node to a SerializationHandler.protected voidcopyNS(int nodeID, SerializationHandler handler, boolean inScope)Copy namespace nodes.protected voidcopyTextNode(int nodeID, SerializationHandler handler)Copy the String value of a Text node to a SerializationHandlervoiddispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize)The optimized version of SAX2DTM.dispatchCharactersEvents(int, ContentHandler, boolean).voidendDocument()Receive notification of the end of the document.voidendElement(String uri, String localName, String qName)Receive notification of the end of an element.intgetExpandedTypeID2(int nodeHandle)The optimized version of DTMDefaultBase.getExpandedTypeID(int).intgetFirstAttribute(int nodeHandle)The optimized version of DTMDefaultBase.getFirstAttribute().protected intgetFirstAttributeIdentity(int identity)The optimized version of DTMDefaultBase.getFirstAttributeIdentity(int).intgetIdForNamespace(String uri)Get a prefix either from the uri mapping, or just make one up!StringgetLocalName(int nodeHandle)Override SAX2DTM.getLocalName() in SAX2DTM2.protected intgetNextAttributeIdentity(int identity)The optimized version of DTMDefaultBase.getNextAttributeIdentity(int).protected intgetNextNamespaceNode2(int baseID)Return the next namespace node following the given base node.StringgetNodeName(int nodeHandle)The optimized version of SAX2DTM.getNodeName().StringgetNodeNameX(int nodeHandle)The optimized version of SAX2DTM.getNodeNameX().StringgetNodeValue(int nodeHandle)Given a node handle, return its node value.StringgetStringValue()Returns the string value of the entire treeXMLStringgetStringValue(int nodeHandle)Override SAX2DTM.getStringValue(int)StringgetStringValueX(int nodeHandle)The optimized version of SAX2DTM.getStringValue(int).protected intgetTypedAttribute(int nodeHandle, int attType)The optimized version of DTMDefaultBase.getTypedAttribute(int, int).voidprocessingInstruction(String target, String data)Override the processingInstruction() interface in SAX2DTM2.voidstartDocument()Receive notification of the beginning of the document.voidstartElement(String uri, String localName, String qName, Attributes attributes)Override SAX2DTM.startElement()Methods inherited from class org.apache.xml.dtm.ref.sax2dtm.SAX2DTM
_dataOrQName, addNewDTMID, attributeDecl, characters, clearCoRoutine, clearCoRoutine, declAlreadyDeclared, dispatchToEvents, elementDecl, endCDATA, endDTD, endEntity, endPrefixMapping, error, externalEntityDecl, fatalError, getAttributeNode, getContentHandler, getDeclHandler, getDocumentTypeDeclarationPublicIdentifier, getDocumentTypeDeclarationSystemIdentifier, getDTDHandler, getElementById, getEntityResolver, getErrorHandler, getFixedNames, getLexicalHandler, getNamespaceURI, getNamespaceURI, getNextNodeIdentity, getNumberOfNodes, getPrefix, getPrefix, getSourceLocatorFor, getUnparsedEntityURI, ignorableWhitespace, internalEntityDecl, isAttributeSpecified, isWhitespace, migrateTo, needsTwoThreads, nextNode, notationDecl, resolveEntity, setDocumentLocator, setIDAttribute, setIncrementalSAXSource, setProperty, setSourceLocation, setUseSourceLocation, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseIterators
getAxisIterator, getTypedAxisIteratorMethods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseTraversers
getAxisTraverserMethods inherited from class org.apache.xml.dtm.ref.DTMDefaultBase
_firstch, _level, _nextsib, _parent, _prevsib, _type, appendChild, appendTextChild, declareNamespaceInContext, documentRegistration, documentRelease, dumpDTM, dumpNode, ensureSizeOfIndex, error, findGTE, findInSortedSuballocatedIntVector, findNamespaceContext, getDocument, getDocumentAllDeclarationsProcessed, getDocumentBaseURI, getDocumentEncoding, getDocumentRoot, getDocumentStandalone, getDocumentSystemIdentifier, getDocumentVersion, getDTMIDs, getExpandedTypeID, getExpandedTypeID, getFirstChild, getFirstNamespaceNode, getLastChild, getLevel, getLocalNameFromExpandedNameID, getManager, getNamespaceFromExpandedNameID, getNamespaceType, getNextAttribute, getNextNamespaceNode, getNextSibling, getNode, getNodeHandle, getNodeIdent, getNodeType, getOwnerDocument, getParent, getPreviousSibling, getShouldStripWhitespace, getStringValueChunk, getStringValueChunkCount, getTypedFirstChild, getTypedNextSibling, hasChildNodes, indexNode, isCharacterElementContentWhitespace, isDocumentAllDeclarationsProcessed, isNodeAfter, isSupported, makeNodeHandle, makeNodeIdentity, popShouldStripWhitespace, pushShouldStripWhitespace, setDocumentBaseURI, setFeature, setShouldStripWhitespace, supportsPreStripping
-
Field Details
-
m_extendedTypes
-
m_values
-
m_SHIFT
protected int m_SHIFT -
m_MASK
protected int m_MASK -
m_blocksize
protected int m_blocksize -
TEXT_LENGTH_BITS
protected static final int TEXT_LENGTH_BITS%OPT% If the offset and length of a Text node are within certain limits, we store a bitwise encoded value into an int, using 10 bits (max. 1024) for length and 21 bits for offset. We can save two SuballocatedIntVector calls for each getStringValueX() and dispatchCharacterEvents() call by doing this.- See Also:
- Constant Field Values
-
TEXT_OFFSET_BITS
protected static final int TEXT_OFFSET_BITS- See Also:
- Constant Field Values
-
TEXT_LENGTH_MAX
protected static final int TEXT_LENGTH_MAX- See Also:
- Constant Field Values
-
TEXT_OFFSET_MAX
protected static final int TEXT_OFFSET_MAX- See Also:
- Constant Field Values
-
m_buildIdIndex
protected boolean m_buildIdIndex
-
-
Constructor Details
-
SAX2DTM2
public SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing)Construct a SAX2DTM2 object using the default block size. -
SAX2DTM2
public SAX2DTM2(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, int blocksize, boolean usePrevsib, boolean buildIdIndex, boolean newNameTable)Construct a SAX2DTM2 object using the given block size.
-
-
Method Details
-
_exptype
public final int _exptype(int identity)Override DTMDefaultBase._exptype() by dropping the incremental code.This one is less efficient than _exptype2. It is only used during DTM building. _exptype2 is used after the document is fully built.
- Overrides:
_exptypein classDTMDefaultBase- Parameters:
identity- The node identity.- Returns:
- The expanded type ID, or DTM.NULL.
-
_exptype2
public final int _exptype2(int identity)The optimized version of DTMDefaultBase._exptype().- Parameters:
identity- A node identity, which must not be equal toDTM.NULL
-
_nextsib2
public final int _nextsib2(int identity)The optimized version of DTMDefaultBase._nextsib().- Parameters:
identity- A node identity, which must not be equal toDTM.NULL
-
_firstch2
public final int _firstch2(int identity)The optimized version of DTMDefaultBase._firstch().- Parameters:
identity- A node identity, which must not be equal toDTM.NULL
-
_parent2
public final int _parent2(int identity)The optimized version of DTMDefaultBase._parent().- Parameters:
identity- A node identity, which must not be equal toDTM.NULL
-
_type2
public final int _type2(int identity)The optimized version of DTMDefaultBase._type().- Parameters:
identity- A node identity, which must not be equal toDTM.NULL
-
getExpandedTypeID2
public final int getExpandedTypeID2(int nodeHandle)The optimized version of DTMDefaultBase.getExpandedTypeID(int).This one is only used by DOMAdapter.getExpandedTypeID(int), which is mostly called from the compiled translets.
-
_exptype2Type
public final int _exptype2Type(int exptype)Return the node type from the expanded type -
getIdForNamespace
Get a prefix either from the uri mapping, or just make one up!- Overrides:
getIdForNamespacein classSAX2DTM- Parameters:
uri- The namespace URI, which may be null.- Returns:
- The prefix if there is one, or null.
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXExceptionOverride SAX2DTM.startElement()Receive notification of the start of an element.
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classSAX2DTM- Parameters:
uri- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName- The qualified name (with prefix), or the empty string if qualified names are not available.attributes- The specified or defaulted attributes.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
endElement
Receive notification of the end of an element.By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classSAX2DTM- Parameters:
uri- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.localName- The local name (without prefix), or the empty string if Namespace processing is not being performed.qName- The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
-
comment
Report an XML comment anywhere in the document.This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).
- Specified by:
commentin interfaceLexicalHandler- Overrides:
commentin classSAX2DTM- Parameters:
ch- An array holding the characters in the comment.start- The starting position in the array.length- The number of characters to use from the array.- Throws:
SAXException- The application may raise an exception.
-
startDocument
Receive notification of the beginning of the document.- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classSAX2DTM- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.startDocument()
-
endDocument
Receive notification of the end of the document.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classSAX2DTM- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.endDocument()
-
addNode
protected final int addNode(int type, int expandedTypeID, int parentIndex, int previousSibling, int dataOrPrefix, boolean canHaveFirstChild)Construct the node map from the node.- Overrides:
addNodein classSAX2DTM- Parameters:
type- raw type ID, one of DTM.XXX_NODE.expandedTypeID- The expended type ID.parentIndex- The current parent index.previousSibling- The previous sibling index.dataOrPrefix- index into m_data table, or string handle.canHaveFirstChild- true if the node can have a first child, false if it is atomic.- Returns:
- The index identity of the node that was added.
-
charactersFlush
protected final void charactersFlush()Check whether accumulated text should be stripped; if not, append the appropriate flavor of text/cdata node.- Overrides:
charactersFlushin classSAX2DTM
-
processingInstruction
Override the processingInstruction() interface in SAX2DTM2.%OPT% This one is different from SAX2DTM.processingInstruction() in that we do not use extended types for PI nodes. The name of the PI is saved in the DTMStringPool. Receive notification of a processing instruction.
- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin classSAX2DTM- Parameters:
target- The processing instruction target.data- The processing instruction data, or null if none is supplied.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.- See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)
-
getFirstAttribute
public final int getFirstAttribute(int nodeHandle)The optimized version of DTMDefaultBase.getFirstAttribute().Given a node handle, get the index of the node's first attribute.
- Specified by:
getFirstAttributein interfaceDTM- Overrides:
getFirstAttributein classDTMDefaultBase- Parameters:
nodeHandle- int Handle of the node.- Returns:
- Handle of first attribute, or DTM.NULL to indicate none exists.
-
getFirstAttributeIdentity
protected int getFirstAttributeIdentity(int identity)The optimized version of DTMDefaultBase.getFirstAttributeIdentity(int).Given a node identity, get the index of the node's first attribute.
- Overrides:
getFirstAttributeIdentityin classDTMDefaultBase- Parameters:
identity- int identity of the node.- Returns:
- Identity of first attribute, or DTM.NULL to indicate none exists.
-
getNextAttributeIdentity
protected int getNextAttributeIdentity(int identity)The optimized version of DTMDefaultBase.getNextAttributeIdentity(int).Given a node identity for an attribute, advance to the next attribute.
- Overrides:
getNextAttributeIdentityin classDTMDefaultBase- Parameters:
identity- int identity of the attribute node. This must be an attribute node.- Returns:
- int DTM node-identity of the resolved attr, or DTM.NULL to indicate none exists.
-
getTypedAttribute
protected final int getTypedAttribute(int nodeHandle, int attType)The optimized version of DTMDefaultBase.getTypedAttribute(int, int).Given a node handle and an expanded type ID, get the index of the node's attribute of that type, if any.
- Overrides:
getTypedAttributein classDTMDefaultBase- Parameters:
nodeHandle- int Handle of the node.attType- int expanded type ID of the required attribute.- Returns:
- Handle of attribute of the required type, or DTM.NULL to indicate none exists.
-
getLocalName
Override SAX2DTM.getLocalName() in SAX2DTM2.Processing for PIs is different. Given a node handle, return its XPath- style localname. (As defined in Namespaces, this is the portion of the name after any colon character).
- Specified by:
getLocalNamein interfaceDTM- Overrides:
getLocalNamein classSAX2DTM- Parameters:
nodeHandle- the id of the node.- Returns:
- String Local name of this node.
-
getNodeNameX
The optimized version of SAX2DTM.getNodeNameX().Given a node handle, return the XPath node name. This should be the name as described by the XPath data model, NOT the DOM- style name.
- Specified by:
getNodeNameXin interfaceDTM- Overrides:
getNodeNameXin classSAX2DTM- Parameters:
nodeHandle- the id of the node.- Returns:
- String Name of this node, which may be an empty string.
-
getNodeName
The optimized version of SAX2DTM.getNodeName().Given a node handle, return its DOM-style node name. This will include names such as #text or #document.
- Specified by:
getNodeNamein interfaceDTM- Overrides:
getNodeNamein classSAX2DTM- Parameters:
nodeHandle- the id of the node.- Returns:
- String Name of this node, which may be an empty string. %REVIEW% Document when empty string is possible... %REVIEW-COMMENT% It should never be empty, should it?
-
getStringValue
Override SAX2DTM.getStringValue(int)This method is only used by Xalan-J Interpretive. It is not used by XSLTC.
If the caller supplies an XMLStringFactory, the getStringValue() interface in SAX2DTM will be called. Otherwise just calls getStringValueX() and wraps the returned String in an XMLString. 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).
- Specified by:
getStringValuein interfaceDTM- Overrides:
getStringValuein classSAX2DTM- Parameters:
nodeHandle- The node ID.- Returns:
- A string object that represents the string-value of the given node.
-
getStringValueX
The optimized version of SAX2DTM.getStringValue(int).%OPT% This is one of the most often used interfaces. Performance is critical here. This one is different from SAX2DTM.getStringValue(int) in that it returns a String instead of a XMLString. 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).
- Parameters:
nodeHandle- The node ID.- Returns:
- A string object that represents the string-value of the given node.
-
getStringValue
Returns the string value of the entire tree -
dispatchCharactersEvents
public final void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXExceptionThe optimized version of SAX2DTM.dispatchCharactersEvents(int, ContentHandler, boolean).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). Multiple calls to the ContentHandler's characters methods may well occur for a single call to this method.
- Specified by:
dispatchCharactersEventsin interfaceDTM- Overrides:
dispatchCharactersEventsin classSAX2DTM- Parameters:
nodeHandle- The node ID.ch- A non-null reference to a ContentHandler.normalize- true if the content should be normalized according to the rules for the XPath normalize-space function.- Throws:
SAXException
-
getNodeValue
Given a node handle, return its node value. This is mostly as defined by the DOM, but may ignore some conveniences.- Specified by:
getNodeValuein interfaceDTM- Overrides:
getNodeValuein classSAX2DTM- Parameters:
nodeHandle- The node id.- Returns:
- String Value of this node, or null if not meaningful for this node type.
-
copyTextNode
Copy the String value of a Text node to a SerializationHandler- Throws:
SAXException
-
copyElement
protected final String copyElement(int nodeID, int exptype, SerializationHandler handler) throws SAXExceptionCopy an Element node to a SerializationHandler.- Parameters:
nodeID- The node identityexptype- The expanded type of the Element nodehandler- The SerializationHandler- Returns:
- The qualified name of the Element node.
- Throws:
SAXException
-
copyNS
protected final void copyNS(int nodeID, SerializationHandler handler, boolean inScope) throws SAXExceptionCopy namespace nodes.- Parameters:
nodeID- The Element node identityhandler- The SerializationHandlerinScope- true if all namespaces in scope should be copied, false if only the namespace declarations should be copied.- Throws:
SAXException
-
getNextNamespaceNode2
protected final int getNextNamespaceNode2(int baseID)Return the next namespace node following the given base node.- Returns:
- The namespace node immediately following the base node.
-
copyAttributes
Copy attribute nodes from an element .- Parameters:
nodeID- The Element node identityhandler- The SerializationHandler- Throws:
SAXException
-
copyAttribute
protected final void copyAttribute(int nodeID, int exptype, SerializationHandler handler) throws SAXExceptionCopy an Attribute node to a SerializationHandler- Parameters:
nodeID- The node identityexptype- The expanded type of the Element nodehandler- The SerializationHandler- Throws:
SAXException
-