You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2001/04/27 18:33:04 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/dtm DTM.java DTMBuilder.java DTMDocumentImpl.java TestDTMNodes.java
jkesselm 01/04/27 09:33:04
Modified: java/src/org/apache/xml/dtm Tag: DTM_EXP DTM.java
DTMBuilder.java DTMDocumentImpl.java
TestDTMNodes.java
Log:
Copy ChunkedIntArray into this package (from Xalan1 version of DTM)
Revision Changes Path
No revision
No revision
1.1.2.9 +5 -15 xml-xalan/java/src/org/apache/xml/dtm/Attic/DTM.java
Index: DTM.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTM.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- DTM.java 2001/04/26 19:00:10 1.1.2.8
+++ DTM.java 2001/04/27 16:33:00 1.1.2.9
@@ -211,7 +211,7 @@
/**
* Retrieves an attribute node by qualified name.
* <br>To retrieve an attribute node by local name and namespace URI,
- * use the <code>getAttributeNodeNS</code> method.
+ * use the <code>getAttributeNode(ns,local)</code> method.
*
* %REVIEW% I don't think XPath model needs it... but DOM support might.
*
@@ -226,20 +226,10 @@
/**
* Retrieves an attribute node by local name and namespace URI
*
- * @param name The namespace URI of the attribute to
- * retrieve, or null.
- * @param name The local name of the attribute to
- * retrieve.
- * @return The attribute node handle with the specified name (
- * <code>nodeName</code>) or <code>DTM.NULL</code> if there is no such
- * attribute.
- */
- public int getAttributeNode(String namespaceURI, String name);
-
- /**
- * Retrieves an attribute node by name.
- * <br>To retrieve an attribute node by qualified name and namespace URI,
- * use the <code>getAttributeNodeNS</code> method.
+ * %REVIEW% Note that this uses method overloading by argument signature.
+ * since we also have the single-string lookup by qname.
+ * If we ever want to port this to a language which doesn't support this
+ * capability, we might want to rename this to getAttributeNodeNS.
*
* @param name The namespace URI of the attribute to
* retrieve, or null.
1.1.2.2 +20 -20 xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMBuilder.java
Index: DTMBuilder.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMBuilder.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DTMBuilder.java 2001/04/22 22:08:27 1.1.2.1
+++ DTMBuilder.java 2001/04/27 16:33:01 1.1.2.2
@@ -115,13 +115,13 @@
// Scott suggests sharing pools between DTMs. Note that this will require
// threadsafety at the pool level.
- private static DTMStringPool commonLocalNames=new DTMSafeStringPool();
- private static DTMStringPool commonAttributeNames=new DTMSafeStringPool();
+ private static DTMStringPool commonLocalElementNames=new DTMSafeStringPool();
+ private static DTMStringPool commonLocalAttributeNames=new DTMSafeStringPool();
private static DTMStringPool commonNamespaceNames=new DTMSafeStringPool();
private static DTMStringPool commonPrefixes=new DTMSafeStringPool();
- private DTMStringPool localNames; // For this DTM, may be common
- private DTMStringPool attributeNames; // For this DTM, may be common
+ private DTMStringPool localElementNames; // For this DTM, may be common
+ private DTMStringPool localAttributeNames; // For this DTM, may be common
private DTMStringPool namespaceNames; // For this DTM, may be common
private DTMStringPool prefixes;
private FastStringBuffer content; // Unique per DTM
@@ -139,27 +139,27 @@
{
// Start with persistant shared pools unless the DTM expresses
// other preferences
- localNames=dtm.getLocalNames();
- if(localNames==null)
- dtm.setLocalNames(localNames=commonLocalNames);
-
- attributeNames=dtm.getAttributeNames();
- if(attributeNames==null)
- dtm.setAttributeNames(attributeNames=commonAttributeNames);
+ localElementNames=dtm.getElementNameTable();
+ if(localElementNames==null)
+ dtm.setElementNameTable(localElementNames=commonLocalElementNames);
+
+ localAttributeNames=dtm.getAttributeNameTable();
+ if(localAttributeNames==null)
+ dtm.setAttributeNameTable(localAttributeNames=commonLocalAttributeNames);
- namespaceNames=dtm.getnamespaceNames();
+ namespaceNames=dtm.getNsNameTable();
if(namespaceNames==null)
- dtm.setNamespaceNames(namespaceNames=commonNamespaceNames);
+ dtm.setNsNameTable(namespaceNames=commonNamespaceNames);
- prefixes=dtm.getPrefixes();
+ prefixes=dtm.getPrefixNameTable();
if(prefixes==null)
- dtm.setPrefixes(prefixes=commonPrefixes);
+ dtm.setPrefixNameTable(prefixes=commonPrefixes);
// Unlike the other strings, which may be shared and thus should be
// reset elsewhere (if at all), content starts empty each time we parse.
- content=dtm.getcontent();
+ content=dtm.getContentBuffer();
if(content==null)
- dtm.setcontent(content=new FastStringBuffer());
+ dtm.setContentBuffer(content=new FastStringBuffer());
else
content.reset();
contentStart=0;
@@ -272,7 +272,7 @@
// %TBD% Where do we pool expandedName, or is it just the union, or...
dtm.startElement(namespaceNames.stringToIndex(namespaceURI),
- localNames.stringToIndex(localName),
+ localElementNames.stringToIndex(localName),
prefixes.stringToIndex(prefix)); /////// %TBD%
// %TBD% I'm assuming that DTM will require resequencing of
@@ -298,7 +298,7 @@
int contentEnd=content.length();
dtm.appendNSDeclaration(namespaceNames.stringToIndex(atts.getURI(i)),
- attributeNames.stringToIndex(localName),
+ localAttributeNames.stringToIndex(localName),
prefixes.stringToIndex(prefix),
contentStart, contentEnd-contentStart,
atts.getType(i).equalsIgnoreCase("ID"));
@@ -323,7 +323,7 @@
if(!("xmlns".equals(prefix) || "xmlns".equals(qName)))
dtm.appendAttribute(namespaceNames.stringToIndex(atts.getURI(i)),
- attributeNames.stringToIndex(localName),
+ localAttributeNames.stringToIndex(localName),
prefixes.stringToIndex(prefix),
atts.getType(i).equalsIgnoreCase("ID"),
contentStart, contentEnd-contentStart,
1.1.2.2 +60 -5 xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDocumentImpl.java
Index: DTMDocumentImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDocumentImpl.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DTMDocumentImpl.java 2001/04/26 17:50:01 1.1.2.1
+++ DTMDocumentImpl.java 2001/04/27 16:33:01 1.1.2.2
@@ -60,7 +60,7 @@
import java.util.Stack;
import java.util.Vector;
-import org.apache.xalan.xpath.dtm.ChunkedIntArray;
+import org.apache.xml.dtm.ChunkedIntArray;
import org.apache.xml.utils.FastStringBuffer;
import org.xml.sax.Attributes;
@@ -186,35 +186,90 @@
*
* @param poolRef DTMStringPool reference to an instance of table.
*/
- protected void setElementNameTable(DTMStringPool poolRef) {
+ void setElementNameTable(DTMStringPool poolRef) {
m_elementNames = poolRef;
}
/**
+ * Get a reference pointer to the element name symbol table.
+ *
+ * @return DTMStringPool reference to an instance of table.
+ */
+ DTMStringPool getElementNameTable() {
+ return m_elementNames;
+ }
+
+ /**
* Set a reference pointer to the namespace URI symbol table.
*
* @param poolRef DTMStringPool reference to an instance of table.
*/
- protected void setNsNameTable(DTMStringPool poolRef) {
+ void setNsNameTable(DTMStringPool poolRef) {
m_nsNames = poolRef;
}
/**
+ * Get a reference pointer to the namespace URI symbol table.
+ *
+ * @return DTMStringPool reference to an instance of table.
+ */
+ DTMStringPool getNsNameTable() {
+ return m_nsNames;
+ }
+
+ /**
* Set a reference pointer to the attribute name symbol table.
*
* @param poolRef DTMStringPool reference to an instance of table.
*/
- protected void setAttributeNameTable(DTMStringPool poolRef) {
+ void setAttributeNameTable(DTMStringPool poolRef) {
m_attributeNames = poolRef;
}
/**
+ * Get a reference pointer to the attribute name symbol table.
+ *
+ * @return DTMStringPool reference to an instance of table.
+ */
+ DTMStringPool getAttributeNameTable() {
+ return m_attributeNames;
+ }
+
+ /**
* Set a reference pointer to the prefix name symbol table.
*
* @param poolRef DTMStringPool reference to an instance of table.
*/
- protected void setPrefixNameTable(DTMStringPool poolRef) {
+ void setPrefixNameTable(DTMStringPool poolRef) {
m_prefixNames = poolRef;
+ }
+
+ /**
+ * Get a reference pointer to the prefix name symbol table.
+ *
+ * @return DTMStringPool reference to an instance of table.
+ */
+ DTMStringPool getPrefixNameTable() {
+ return m_prefixNames;
+ }
+
+ /**
+ * Set a reference pointer to the content-text repository
+ *
+ * @param bufferRef FastStringBuffer reference to an instance of
+ * buffer
+ */
+ void setContentBuffer(FastStringBuffer buffer) {
+ m_char = buffer;
+ }
+
+ /**
+ * Get a reference pointer to the content-text repository
+ *
+ * @return FastStringBuffer reference to an instance of buffer
+ */
+ FastStringBuffer getContentBuffer() {
+ return m_char;
}
// ========= Document Handler Functions =========
1.1.2.2 +1 -1 xml-xalan/java/src/org/apache/xml/dtm/Attic/TestDTMNodes.java
Index: TestDTMNodes.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/TestDTMNodes.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- TestDTMNodes.java 2001/04/26 17:50:01 1.1.2.1
+++ TestDTMNodes.java 2001/04/27 16:33:01 1.1.2.2
@@ -1,6 +1,6 @@
package org.apache.xml.dtm;
-import org.apache.xalan.xpath.dtm.ChunkedIntArray;
+import org.apache.xml.dtm.ChunkedIntArray;
public class TestDTMNodes {
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org