org.apache.xalan.xsltc.dom
public final class SAXImpl extends SAX2DTM2 implements DOMEnhancedForDTM, DOMBuilder
DOMSource inputs are handled using DOM2SAX + SAXImpl. SAXImpl has a few specific fields (e.g. _node2Ids, _document) to keep DOM-related information. They are used when the processing behavior between DOM and SAX has to be different. Examples of these include id function and unparsed entity.
SAXImpl extends SAX2DTM2 instead of SAX2DTM for better performance.
Nested Class Summary | |
---|---|
class | SAXImpl.NamespaceAttributeIterator
Iterator that returns attributes within a given namespace for a node. |
class | SAXImpl.NamespaceChildrenIterator
Iterator that returns children within a given namespace for a
given node. |
class | SAXImpl.NamespaceWildcardIterator
Iterator that handles node tests that test for a namespace, but have
a wild card for the local name of the node, i.e., node tests of the
form |
class | SAXImpl.TypedNamespaceIterator
Iterator that returns the namespace nodes as defined by the XPath data
model for a given node, filtered by extended type ID. |
Constructor Summary | |
---|---|
SAXImpl(XSLTCDTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, boolean buildIdIndex)
Construct a SAXImpl object using the default block size. | |
SAXImpl(XSLTCDTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, int blocksize, boolean buildIdIndex, boolean newNameTable)
Construct a SAXImpl object using the given block size. |
Method Summary | |
---|---|
void | characters(char[] ch, int start, int length)
SAX2: Receive notification of character data. |
void | characters(int node, SerializationHandler handler)
Copy the string value of a node directly to an output handler |
void | comment(char[] ch, int start, int length)
SAX2: Report an XML comment anywhere in the document. |
void | copy(DTMAxisIterator nodes, SerializationHandler handler)
Copy a node-set to an output handler |
void | copy(SerializationHandler handler)
Copy the whole tree to an output handler |
void | copy(int node, SerializationHandler handler)
Performs a deep copy (ref. |
void | endDocument()
SAX2: Receive notification of the end of a document. |
void | endElement(String namespaceURI, String localName, String qname)
SAX2: Receive notification of the end of an element. |
int | getAttributeNode(int type, int element)
Returns the attribute node of a given type (if any) for an element |
String | getAttributeValue(int type, int element)
Returns the value of a given attribute type of a given element |
String | getAttributeValue(String name, int element)
This method is for testing/debugging only |
DTMAxisIterator | getAxisIterator(int axis)
This is a shortcut to the iterators that implement the
supported XPath axes (only namespace::) is not supported.
|
DOMBuilder | getBuilder()
Returns an instance of the DOMBuilder inner class
This class will consume the input document through a SAX2
interface and populate the tree. |
DTMAxisIterator | getChildren(int node)
Returns an iterator with all the children of a given node |
String | getDocumentURI()
Returns the origin of the document from which the tree was built |
String | getDocumentURI(int node) |
int | getElementById(String idString)
Return the node identity for a given id String
|
Hashtable | getElementsWithIDs()
%HZ% Need Javadoc |
int | getGeneralizedType(String name)
Returns the internal type associated with an expanded QName |
int | getGeneralizedType(String name, boolean searchOnly)
Returns the internal type associated with an expanded QName |
DTMAxisIterator | getIterator()
Returns singleton iterator containg the document root
Works for them main document (mark == 0). |
String | getLanguage(int node)
Returns a node' defined language for a node (if any) |
short[] | getMapping(String[] names, String[] uris, int[] types)
Get mapping from DOM element/attribute types to external types |
DTMAxisIterator | getNamespaceAxisIterator(int axis, int ns)
Do not think that this returns an iterator for the namespace axis.
|
short[] | getNamespaceMapping(String[] namespaces)
Get mapping from DOM namespace types to external namespace types |
String | getNamespaceName(int node)
Returns the namespace URI to which a node belongs |
int | getNamespaceType(int node)
Returns the namespace type of a specific node |
String | getNodeName(int node)
Returns the name of a node (attribute or element). |
DTMAxisIterator | getNodeValueIterator(DTMAxisIterator iterator, int type, String value, boolean op) |
int | getNSType(int node)
Get mapping from DOM namespace types to external namespace types |
DTMAxisIterator | getNthDescendant(int type, int n, boolean includeself)
Returns the nth descendant of a node |
SerializationHandler | getOutputDomBuilder()
Return a SerializationHandler for output handling.
|
DOM | getResultTreeFrag(int initSize, int rtfType)
Return a instance of a DOM class to be used as an RTF |
DOM | getResultTreeFrag(int initSize, int rtfType, boolean addToManager)
Return a instance of a DOM class to be used as an RTF
|
int[] | getReverseMapping(String[] names, String[] uris, int[] types)
Get mapping from external element/attribute types to DOM types |
short[] | getReverseNamespaceMapping(String[] namespaces)
Get mapping from external namespace types to DOM namespace types |
int | getSize()
Returns the number of nodes in the tree (used for indexing) |
DTMAxisIterator | getTypedAxisIterator(int axis, int type)
Similar to getAxisIterator, but this one returns an iterator
containing nodes of a typed axis (ex.: child::foo) |
DTMAxisIterator | getTypedChildren(int type)
Returns an iterator with all children of a specific type
for a given node (element) |
DTMAxisIterator | getTypedDescendantIterator(int type)
Returns an iterator with all descendants of a node that are of
a given type. |
String | getUnparsedEntityURI(String name)
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 | hasDOMSource()
Return true if the input source is DOMSource. |
void | ignorableWhitespace(char[] ch, int start, int length)
SAX2: Receive notification of ignorable whitespace in element
content. |
boolean | isAttribute(int node)
Returns 'true' if a specific node is an attribute (of any type) |
boolean | isElement(int node)
Returns 'true' if a specific node is an element (of any type) |
boolean | lessThan(int node1, int node2)
Returns true if node1 comes before node2 in document order |
String | lookupNamespace(int node, String prefix)
Lookup a namespace URI from a prefix starting at node. |
Node | makeNode(int index)
Create an org.w3c.dom.Node from a node in the tree |
Node | makeNode(DTMAxisIterator iter)
Create an org.w3c.dom.Node from a node in an iterator
The iterator most be started before this method is called |
NodeList | makeNodeList(int index)
Create an org.w3c.dom.NodeList from a node in the tree |
NodeList | makeNodeList(DTMAxisIterator iter)
Create an org.w3c.dom.NodeList from a node iterator
The iterator most be started before this method is called |
void | migrateTo(DTMManager manager)
Migrate a DTM built with an old DTMManager to a new DTMManager.
|
DTMAxisIterator | orderNodes(DTMAxisIterator source, int node)
Encapsulates an iterator in an OrderedIterator to ensure node order |
void | print(int node, int level)
Prints the whole tree to standard output |
void | processingInstruction(String target, String data)
SAX2: Receive notification of a processing instruction. |
void | setDocumentURI(String uri)
Define the origin of the document from which the tree was built |
boolean | setEscaping(boolean value) |
void | setFilter(StripFilter filter)
Part of the DOM interface - no function here. |
void | setupMapping(String[] names, String[] urisArray, int[] typesArray, String[] namespaces) |
String | shallowCopy(int node, SerializationHandler handler)
Performs a shallow copy (ref. |
void | startDocument()
SAX2: Receive notification of the beginning of a document. |
void | startElement(String uri, String localName, String qname, Attributes attributes, Node node)
Specialized interface used by DOM2SAX. |
void | startElement(String uri, String localName, String qname, Attributes attributes)
SAX2: Receive notification of the beginning of an element. |
void | startPrefixMapping(String prefix, String uri)
SAX2: Begin the scope of a prefix-URI Namespace mapping. |
Parameters: idString The id String
Returns: The identity of the node whose id is the given String.
Parameters: initSize The initial size of the DOM. rtfType The type of the RTF addToManager true if the RTF should be registered with the DTMManager.
Returns: The DOM object which represents the RTF.
Parameters: manager the DTMManager