jkesselm 01/05/21 12:43:57
Modified: java/src/org/apache/xml/dtm Tag: DTM_EXP DTMDefaultBase.java
DTMNodeProxy.java
java/src/org/apache/xml/dtm/dom2dtm Tag: DTM_EXP
DOM2DTM.java
Added: java/src/org/apache/xml/dtm Tag: DTM_EXP
DTMDOMException.java DTMNodeIterator.java
Log:
DTMNodeIterator -- DOM-level NodeIterator over
DTM view of document
DTMDOMException -- factored out of DTMNodeProxy, so it
can be chared with DTMNodeIterator.
Revision Changes Path
No revision
No revision
1.1.2.11 +6 -1
xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDefaultBase.java
Index: DTMDefaultBase.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDefaultBase.java,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -r1.1.2.10 -r1.1.2.11
--- DTMDefaultBase.java 2001/05/21 16:03:24 1.1.2.10
+++ DTMDefaultBase.java 2001/05/21 19:43:44 1.1.2.11
@@ -234,13 +234,18 @@
if (capacity <= index)
{
+ int newcapacity = capacity + m_blocksize;
+
+ // %OPT% Compilers might be happier if we operated on one array
+ // at a time, though the parallel code might be a trifle less
+ // obvious.
+
int[] exptype = m_exptype;
byte[] level = m_level;
int[] firstch = m_firstch;
int[] nextsib = m_nextsib;
short[] prevsib = m_prevsib;
short[] parent = m_parent;
- int newcapacity = capacity + m_blocksize;
m_exptype = new int[newcapacity];
m_level = new byte[newcapacity];
1.1.2.2 +48 -77
xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMNodeProxy.java
Index: DTMNodeProxy.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMNodeProxy.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DTMNodeProxy.java 2001/05/17 05:29:38 1.1.2.1
+++ DTMNodeProxy.java 2001/05/21 19:43:47 1.1.2.2
@@ -237,7 +237,7 @@
*/
public final void setPrefix(String prefix) throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -260,7 +260,7 @@
*/
public final boolean supports(String feature, String version)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -273,7 +273,7 @@
*/
public final boolean isSupported(String feature, String version)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -304,7 +304,7 @@
*/
public final void setNodeValue(String nodeValue) throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -353,7 +353,7 @@
*/
public final NodeList getChildNodes()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -436,7 +436,7 @@
public boolean hasAttribute(String name)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
// return false;
}
@@ -453,7 +453,7 @@
public boolean hasAttributeNS(String name, String x)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
// return false;
}
@@ -481,7 +481,7 @@
public final Node insertBefore(Node newChild, Node refChild)
throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -497,7 +497,7 @@
public final Node replaceChild(Node newChild, Node oldChild)
throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -511,7 +511,7 @@
*/
public final Node removeChild(Node oldChild) throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -525,7 +525,7 @@
*/
public final Node appendChild(Node newChild) throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -547,7 +547,7 @@
*/
public final Node cloneNode(boolean deep)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -567,7 +567,7 @@
*/
public final DOMImplementation getImplementation()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -577,7 +577,7 @@
*/
public final Element getDocumentElement()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -591,7 +591,7 @@
*/
public final Element createElement(String tagName) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -601,7 +601,7 @@
*/
public final DocumentFragment createDocumentFragment()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -613,7 +613,7 @@
*/
public final Text createTextNode(String data)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -625,7 +625,7 @@
*/
public final Comment createComment(String data)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -640,7 +640,7 @@
public final CDATASection createCDATASection(String data)
throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -656,7 +656,7 @@
public final ProcessingInstruction createProcessingInstruction(
String target, String data) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -670,7 +670,7 @@
*/
public final Attr createAttribute(String name) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -685,7 +685,7 @@
public final EntityReference createEntityReference(String name)
throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -697,7 +697,7 @@
*/
public final NodeList getElementsByTagName(String tagname)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -713,7 +713,7 @@
public final Node importNode(Node importedNode, boolean deep)
throws DOMException
{
- throw new DTMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
/**
@@ -729,7 +729,7 @@
public final Element createElementNS(
String namespaceURI, String qualifiedName) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -745,7 +745,7 @@
public final Attr createAttributeNS(
String namespaceURI, String qualifiedName) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -759,7 +759,7 @@
public final NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -771,7 +771,7 @@
*/
public final Element getElementById(String elementId)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -785,7 +785,7 @@
*/
public final Text splitText(int offset) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -809,7 +809,7 @@
*/
public final void setData(String data) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -836,7 +836,7 @@
*/
public final String substringData(int offset, int count) throws
DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -848,7 +848,7 @@
*/
public final void appendData(String arg) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -861,7 +861,7 @@
*/
public final void insertData(int offset, String arg) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -874,7 +874,7 @@
*/
public final void deleteData(int offset, int count) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -889,7 +889,7 @@
public final void replaceData(int offset, int count, String arg)
throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -928,7 +928,7 @@
public final void setAttribute(String name, String value)
throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -940,7 +940,7 @@
*/
public final void removeAttribute(String name) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -968,7 +968,7 @@
*/
public final Attr setAttributeNode(Attr newAttr) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -982,7 +982,7 @@
*/
public final Attr removeAttributeNode(Attr oldAttr) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -992,13 +992,13 @@
*/
public boolean hasAttributes()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/** @see org.w3c.dom.Element */
public final void normalize()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1011,7 +1011,7 @@
*/
public final String getAttributeNS(String namespaceURI, String localName)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1027,7 +1027,7 @@
String namespaceURI, String qualifiedName, String value)
throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1041,7 +1041,7 @@
public final void removeAttributeNS(String namespaceURI, String localName)
throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1054,7 +1054,7 @@
*/
public final Attr getAttributeNodeNS(String namespaceURI, String localName)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1068,7 +1068,7 @@
*/
public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1110,7 +1110,7 @@
*/
public final void setValue(String value)
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
/**
@@ -1121,36 +1121,7 @@
*/
public final Element getOwnerElement()
{
- throw new DTMException(DOMException.NOT_SUPPORTED_ERR);
+ throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
}
- /**
- * <meta name="usage" content="internal"/>
- * Simple implementation of DOMException.
- */
- public class DTMException extends org.w3c.dom.DOMException
- {
-
- /**
- * Constructs a DOM/DTM exception.
- *
- * @param code
- * @param message
- */
- public DTMException(short code, String message)
- {
- super(code, message);
- }
-
- /**
- * Constructor DTMException
- *
- *
- * @param code
- */
- public DTMException(short code)
- {
- super(code, "");
- }
- }
}
No revision
No revision
1.1.2.1 +89 -0
xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDOMException.java
1.1.2.1 +206 -0
xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMNodeIterator.java
No revision
No revision
1.1.2.18 +10 -2
xml-xalan/java/src/org/apache/xml/dtm/dom2dtm/Attic/DOM2DTM.java
Index: DOM2DTM.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/dom2dtm/Attic/DOM2DTM.java,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -r1.1.2.17 -r1.1.2.18
--- DOM2DTM.java 2001/05/20 17:33:27 1.1.2.17
+++ DOM2DTM.java 2001/05/21 19:43:54 1.1.2.18
@@ -118,10 +118,10 @@
/** NEEDSDOC Field LEVELINFO_NPERLEVEL */
static final int LEVELINFO_NPERLEVEL = 2;
- /** Samed element for attribute iteration */
+ /** Saved element for attribute iteration */
private Node m_elementForAttrs;
- /** Samed element index for attribute iteration */
+ /** Saved element index for attribute iteration */
private int m_elementForAttrsIndex;
/**
@@ -472,6 +472,12 @@
/**
* Get the handle from a Node.
* <p>%OPT% This will be pretty slow.</p>
+ *
+ * <p>%OPT% An XPath-like search (walk up DOM to root, tracking path;
+ * walk down DTM reconstructing path) might be considerably faster
+ * on later nodes in large documents. That might also imply improving
+ * this call to handle nodes which would be in this DTM but
+ * have not yet been built, which might or might not be a Good Thing.</p>
*
* %REVIEW% This relies on being able to test node-identity via
* object-identity. DTM2DOM proxying is a great example of a case where
@@ -484,6 +490,8 @@
*/
private int getHandleFromNode(Node node)
{
+ // %TBD% Will this ever be called with Nodes that haven't yet been built?
+ // Do we need to be prepared to call nextNode()?
if (null != node)
{
int len = m_nodes.size();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]