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.
Modifier and Type | Class and Description |
---|---|
public class | SAXImpl.
Iterator that returns attributes within a given namespace for a node. |
public class | SAXImpl.
Iterator that returns children within a given namespace for a given node. |
public class | SAXImpl.
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 <axis>::<prefix>:* |
private class | SAXImpl.
This is a specialised iterator for predicates comparing node or attribute values to variable or parameter values. |
public class | SAXImpl.
Iterator that returns the namespace nodes as defined by the XPath data model for a given node, filtered by extended type ID. |
Modifier and Type | Field and Description |
---|---|
private boolean | |
private Document | |
private static int | |
private BitArray | |
private XSLTCDTMManager | |
private boolean | |
private boolean | |
private int | |
private int | |
private Map | |
private NodeList[] | |
private Node[] | |
private Map | |
private boolean | |
private int | |
private int | |
private int | |
private int[] | |
private static final DTMAxisIterator | |
private static final String | |
private static final String | |
private static final String | |
private static final String | |
private static final String |
Access | Constructor and Description |
---|---|
public | SAXImpl(XSLTCDTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, boolean buildIdIndex)
Construct a SAXImpl object using the default block size. |
public | 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. |
Modifier and Type | Method and Description |
---|---|
public void | characters(char[]
the characters from the XML document ch, int the start position in the array start, int the number of characters to read from the array length)Overrides com. Implements org. SAX2: Receive notification of character data. |
public void | characters(final int node, SerializationHandler handler)
Implements com. Copy the string value of a node directly to an output handler |
public void | comment(char[]
An array holding the characters in the comment. ch, int The starting position in the array. start, int The number of characters to use from the array. length)Overrides com. Implements org. SAX2: Report an XML comment anywhere in the document. |
public void | copy(DTMAxisIterator nodes, SerializationHandler handler)
Implements com. Copy a node-set to an output handler |
public void | |
public void | copy(final int node, SerializationHandler handler)
Implements com. Performs a deep copy (ref. |
private final void | |
private void | copyPI(final int node, SerializationHandler handler)
Copies a processing instruction node to an output handler |
private void | |
public void | endDocument()
Overrides com. Implements org. SAX2: Receive notification of the end of a document. |
public void | endElement(String
the Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed namespaceURI, String the local name (without prefix), or the
empty string if Namespace processing is not being
performed localName, String the qualified XML name (with prefix), or the
empty string if qualified names are not available qname)Overrides com. Implements org. SAX2: Receive notification of the end of an element. |
public int | getAttributeNode(final int type, final int element)
Implements com. Returns the attribute node of a given type (if any) for an element |
public String | getAttributeValue(final int type, final int element)
Returns the value of a given attribute type of a given element |
public String | |
public DTMAxisIterator | getAxisIterator(final int
One of Axes.ANCESTORORSELF, etc. axis)Overrides com. Implements com. This is a shortcut to the iterators that implement the supported XPath axes (only namespace::) is not supported. |
public 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. |
public DTMAxisIterator | getChildren(final int node)
Implements com. Returns an iterator with all the children of a given node |
public String | getDocumentURI()
Implements com. Returns the origin of the document from which the tree was built |
public String | |
public int | Returns: The identity of the node whose id is the given String.The id String idString)Overrides com. Implements com. Return the node identity for a given id String |
public Map | Returns: the attributes map.Implements com. Return the attributes map. |
public int | |
public int | getGeneralizedType(final String name, boolean searchOnly)
Returns the internal type associated with an expanded QName |
public DTMAxisIterator | getIterator()
Implements com. Returns singleton iterator containg the document root Works for them main document (mark == 0). |
public String | getLanguage(int node)
Implements com. Returns a node' defined language for a node (if any) |
public short[] | getMapping(String[] names, String[] uris, int[] types)
Implements com. Get mapping from DOM element/attribute types to external types |
private short[] | getMapping2(String[] names, String[] uris, int[] types)
Get mapping from DOM element/attribute types to external types. |
public DTMAxisIterator | getNamespaceAxisIterator(int axis, int ns)
Implements com. Do not think that this returns an iterator for the namespace axis. |
public short[] | getNamespaceMapping(String[] namespaces)
Implements com. Get mapping from DOM namespace types to external namespace types |
public String | getNamespaceName(final int node)
Implements com. Returns the namespace URI to which a node belongs |
public int | getNamespaceType(final int
the id of the node. node)Overrides com. Implements com. Returns the namespace type of a specific node |
public String | getNodeName(final int
the id of the node. node)Overrides com. Implements com. Returns the name of a node (attribute or element). |
public DTMAxisIterator | getNodeValueIterator(DTMAxisIterator iterator, int type, String value, boolean op)
Implements com.
|
public int | getNSType(int node)
Implements com. Get mapping from DOM namespace types to external namespace types |
public DTMAxisIterator | getNthDescendant(int type, int n, boolean includeself)
Implements com. Returns the nth descendant of a node |
public SerializationHandler | getOutputDomBuilder()
Implements com. Return a SerializationHandler for output handling. |
public DOM | getResultTreeFrag(int initSize, int rtfType)
Implements com. Return a instance of a DOM class to be used as an RTF |
public DOM | Returns: The DOM object which represents the RTF.The initial size of the DOM. initSize, int The type of the RTF rtfType, boolean true if the RTF should be registered with the DTMManager. addToManager)Implements com. Return a instance of a DOM class to be used as an RTF |
public int[] | getReverseMapping(String[] names, String[] uris, int[] types)
Implements com. Get mapping from external element/attribute types to DOM types |
public short[] | getReverseNamespaceMapping(String[] namespaces)
Implements com. Get mapping from external namespace types to DOM namespace types |
protected boolean | Returns: whether or not to strip whitespace nodes.Overrides com. Find out whether or not to strip whitespace nodes. |
public int | getSize()
Implements com. Returns the number of nodes in the tree (used for indexing) |
public DTMAxisIterator | getTypedAxisIterator(int
One of Axes.ANCESTORORSELF, etc. axis, int An extended type ID. type)Overrides com. Implements com. Similar to getAxisIterator, but this one returns an iterator containing nodes of a typed axis (ex.: child::foo) |
public DTMAxisIterator | getTypedChildren(final int type)
Implements com. Returns an iterator with all children of a specific type for a given node (element) |
public DTMAxisIterator | getTypedDescendantIterator(int type)
Returns an iterator with all descendants of a node that are of a given type. |
public String | getUnparsedEntityURI(String
A string containing the Entity Name of the unparsed
entity. name)Overrides com. Implements com. 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]). |
private void | |
public boolean | hasDOMSource()
Implements com. Return true if the input source is DOMSource. |
public void | ignorableWhitespace(char[]
the characters from the XML document ch, int the start position in the array start, int the number of characters to read from the array length)Overrides com. Implements org. SAX2: Receive notification of ignorable whitespace in element content. |
public boolean | isAttribute(final int node)
Implements com. Returns 'true' if a specific node is an attribute (of any type) |
public boolean | isElement(final int node)
Implements com. Returns 'true' if a specific node is an element (of any type) |
public boolean | lessThan(int node1, int node2)
Implements com. Returns true if node1 comes before node2 in document order |
public String | lookupNamespace(int node, String prefix)
Implements com. Lookup a namespace URI from a prefix starting at node. |
public Node | makeNode(int index)
Implements com. Create an org.w3c.dom.Node from a node in the tree |
public Node | makeNode(DTMAxisIterator iter)
Implements com. Create an org.w3c.dom.Node from a node in an iterator The iterator most be started before this method is called |
public NodeList | makeNodeList(int index)
Implements com. Create an org.w3c.dom.NodeList from a node in the tree |
public NodeList | makeNodeList(DTMAxisIterator iter)
Implements com. Create an org.w3c.dom.NodeList from a node iterator The iterator most be started before this method is called |
public void | migrateTo(DTMManager
the DTMManager manager)Overrides com. Implements com. Migrate a DTM built with an old DTMManager to a new DTMManager. |
public DTMAxisIterator | orderNodes(DTMAxisIterator source, int node)
Implements com. Encapsulates an iterator in an OrderedIterator to ensure node order |
public void | |
public void | processingInstruction(String
the processing instruction target target, String the processing instruction data, or null if
none was supplied. The data does not include any
whitespace separating it from the target data)Overrides com. Implements org. SAX2: Receive notification of a processing instruction. |
public void | |
public void | setDocumentURI(String uri)
Implements com. Define the origin of the document from which the tree was built |
public boolean | |
public void | setFilter(StripFilter filter)
Implements com. Part of the DOM interface - no function here. |
public void | setupMapping(String[] names, String[] urisArray, int[] typesArray, String[] namespaces)
Implements com.
|
public String | shallowCopy(final int node, SerializationHandler handler)
Implements com. Performs a shallow copy (ref. |
public void | startDocument()
Overrides com. Implements org. SAX2: Receive notification of the beginning of a document. |
public void | startElement(String uri, String localName, String qname, Attributes attributes, Node node)
Specialized interface used by DOM2SAX. |
public void | startElement(String
the Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed uri, String the local name (without prefix), or the
empty string if Namespace processing is not being
performed localName, String the qualified name (with prefix), or the
empty string if qualified names are not available qname, Attributes the attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object. The value of this object after
startElement returns is undefined attributes)Overrides com. Implements org. SAX2: Receive notification of the beginning of an element. |
public void | startPrefixMapping(String
the Namespace prefix being declared.
An empty string is used for the default element namespace,
which has no prefix. prefix, String the Namespace URI the prefix is mapped to uri)Overrides com. Implements org. SAX2: Begin the scope of a prefix-URI Namespace mapping. |
private void | xmlSpaceDefine(String val, final int node)
Call this when an xml:space attribute is encountered to define the whitespace strip/preserve settings. |
private void | xmlSpaceRevert(final int node)
Call this from endElement() to revert strip/preserve setting to whatever it was before the corresponding startElement(). |