zongaro 2002/12/21 08:20:38
Modified: java/src/org/apache/xalan/lib/sql Tag: XSLTC_DTM
DTMDocument.java DefaultConnectionPool.java
SQLDocument.java
java/src/org/apache/xalan/templates Tag: XSLTC_DTM
ElemForEach.java
java/src/org/apache/xalan/xsltc/cmdline Tag: XSLTC_DTM
Compile.java
java/src/org/apache/xalan/xsltc/compiler Tag: XSLTC_DTM
Mode.java StepPattern.java xpath.cup
java/src/org/apache/xml/dtm Tag: XSLTC_DTM DTMIterator.java
java/src/org/apache/xml/dtm/ref Tag: XSLTC_DTM
DTMChildIterNodeList.java DTMDefaultBase.java
DTMNodeIterator.java DTMNodeList.java
java/src/org/apache/xml/dtm/ref/sax2dtm Tag: XSLTC_DTM
SAX2DTM.java
java/src/org/apache/xpath Tag: XSLTC_DTM NodeSetDTM.java
test Tag: XSLTC_DTM build.xml
Log:
Bringing branch up-to-date with changes from MAIN branch.
Revision Changes Path
No revision
No revision
1.8.2.1 +65 -15
xml-xalan/java/src/org/apache/xalan/lib/sql/DTMDocument.java
Index: DTMDocument.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/DTMDocument.java,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- DTMDocument.java 22 Mar 2002 01:04:39 -0000 1.8
+++ DTMDocument.java 21 Dec 2002 16:20:35 -0000 1.8.2.1
@@ -378,7 +378,7 @@
try
{
Object o = m_ObjectArray.getAt(makeNodeIdentity(parm1));
- if (o != null)
+ if (o != null && o != S_ELEMENT_NODE)
{
return o.toString();
}
@@ -396,31 +396,81 @@
/**
- * @param parm1
- * @return
+ * 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).
+ *
+ * @param nodeHandle The node ID.
+ *
+ * @return A string object that represents the string-value of the given
node.
*/
- public XMLString getStringValue( int parm1 )
+ public XMLString getStringValue(int nodeHandle)
{
- int nodeIdx = makeNodeIdentity(parm1);
+ int nodeIdx = makeNodeIdentity(nodeHandle);
if (DEBUG) System.out.println("getStringValue(" + nodeIdx + ")");
- try
- {
+
Object o = m_ObjectArray.getAt(nodeIdx);
- if (o != null)
+ if ( o == S_ELEMENT_NODE )
{
- return m_xstrf.newstr(o.toString());
+ FastStringBuffer buf = StringBufferPool.get();
+ String s;
+
+ try
+ {
+ getNodeData(nodeIdx, buf);
+
+ s = (buf.length() > 0) ? buf.toString() : "";
+ }
+ finally
+ {
+ StringBufferPool.free(buf);
+ }
+
+ return m_xstrf.newstr( s );
}
- else
+ else if( o != null )
{
- return m_xstrf.emptystr();
- }
+ return m_xstrf.newstr(o.toString());
}
- catch(Exception e)
+ else
+ return(m_xstrf.emptystr());
+ }
+
+ /**
+ * Retrieve the text content of a DOM subtree, appending it into a
+ * user-supplied FastStringBuffer object. Note that attributes are
+ * not considered part of the content of an element.
+ * <p>
+ * There are open questions regarding whitespace stripping.
+ * Currently we make no special effort in that regard, since the standard
+ * DOM doesn't yet provide DTD-based information to distinguish
+ * whitespace-in-element-context from genuine #PCDATA. Note that we
+ * should probably also consider xml:space if/when we address this.
+ * DOM Level 3 may solve the problem for us.
+ * <p>
+ * %REVIEW% Actually, since this method operates on the DOM side of the
+ * fence rather than the DTM side, it SHOULDN'T do
+ * any special handling. The DOM does what the DOM does; if you want
+ * DTM-level abstractions, use DTM-level methods.
+ *
+ * @param nodeIdx Index of node whose subtree is to be walked, gathering
the
+ * contents of all Text or CDATASection nodes.
+ * @param buf FastStringBuffer into which the contents of the text
+ * nodes are to be concatenated.
+ */
+ protected void getNodeData(int nodeIdx, FastStringBuffer buf)
+ {
+ for ( int child = _firstch(nodeIdx) ; child != DTM.NULL ; child =
_nextsib(child) )
{
- error("Getting String Value");
- return null;
+ Object o = m_ObjectArray.getAt(child);
+ if ( o == S_ELEMENT_NODE )
+ getNodeData(child, buf);
+ else if ( o != null )
+ buf.append(o.toString());
}
}
+
+
/**
1.9.10.4 +25 -15
xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
Index: DefaultConnectionPool.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java,v
retrieving revision 1.9.10.3
retrieving revision 1.9.10.4
diff -u -r1.9.10.3 -r1.9.10.4
--- DefaultConnectionPool.java 5 Nov 2002 10:41:32 -0000 1.9.10.3
+++ DefaultConnectionPool.java 21 Dec 2002 16:20:35 -0000 1.9.10.4
@@ -79,7 +79,7 @@
* A placeholder thast will keep the driver loaded
* between calls.
*/
- private Object m_Driver = null;
+ private Driver m_Driver = null;
/**
*/
private static final boolean DEBUG = false;
@@ -438,8 +438,9 @@
{
Connection con = null;
- // Create a Connection
- con = DriverManager.getConnection( m_url, m_ConnectionProtocol );
+ // Create a Connection directly from the Driver that was loaded
+ // with the context class loader. This is to support JDK1.4
+ con = m_Driver.connect(m_url, m_ConnectionProtocol );
return con;
}
@@ -479,24 +480,28 @@
{
// We need to implement the context classloader
Class cls = null;
- try
+ try
{
Method m = Thread.class.getMethod("getContextClassLoader", null);
ClassLoader classLoader = (ClassLoader)
m.invoke(Thread.currentThread(), null);
cls = classLoader.loadClass(m_driver);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
- cls = Class.forName(m_driver);
+ cls = Class.forName(m_driver);
}
-
+
if (cls == null)
cls = Class.forName(m_driver);
// We have also had problems with drivers unloading
// load an instance that will get freed with the class.
- m_Driver = cls.newInstance();
+ m_Driver = (Driver) cls.newInstance();
+ // Register the Driver that was loaded with the Contect Classloader
+ // but we will ask for connections directly from the Driver
+ // instance
+ DriverManager.registerDriver(m_Driver);
}
catch(ClassNotFoundException e)
@@ -606,15 +611,20 @@
* The Pool can be Enabled and Disabled. Disabling the pool
* closes all the outstanding Unused connections and any new
* connections will be closed upon release.
- * @param flag Control the Connection Pool. If it is enabled then
Connections will actuall be held
- * around. If disabled then all unused connections will be instantly
closed and as
- * connections are released they are closed and removed from the pool.
+ *
+ * @param flag Control the Connection Pool.
+ * If it is enabled then Connections will actuall be held
+ * around. If disabled then all unused connections will be instantly
+ * closed and as connections are released they are closed and removed
+ * from the pool.
+ *
* @return
*/
- public void setPoolEnabled( final boolean flag )
+ public void setPoolEnabled( boolean flag )
{
-
+ m_IsActive = flag;
+ if ( ! flag )
+ freeUnused();
}
-
}
1.19.10.2 +6 -6
xml-xalan/java/src/org/apache/xalan/lib/sql/SQLDocument.java
Index: SQLDocument.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/SQLDocument.java,v
retrieving revision 1.19.10.1
retrieving revision 1.19.10.2
diff -u -r1.19.10.1 -r1.19.10.2
--- SQLDocument.java 12 Sep 2002 16:07:32 -0000 1.19.10.1
+++ SQLDocument.java 21 Dec 2002 16:20:35 -0000 1.19.10.2
@@ -144,7 +144,7 @@
private static final String S_CASESENSITIVE = "case-sensitive";
/**
*/
- private static final String S_DEFINITLEYWRITABLE = "definitley-writable";
+ private static final String S_DEFINITELYWRITABLE = "definitely-writable";
/**
*/
private static final String S_ISNULLABLE = "nullable";
@@ -212,7 +212,7 @@
private int m_ColAttrib_CASESENSITIVE_TypeID = 0;
/**
*/
- private int m_ColAttrib_DEFINITLEYWRITEABLE_TypeID = 0;
+ private int m_ColAttrib_DEFINITELYWRITABLE_TypeID = 0;
/**
*/
private int m_ColAttrib_ISNULLABLE_TypeID = 0;
@@ -525,13 +525,13 @@
{
addAttributeToNode(
meta.isDefinitelyWritable(i) ? S_ISTRUE : S_ISFALSE,
- m_ColAttrib_DEFINITLEYWRITEABLE_TypeID, lastColHeaderIdx);
+ m_ColAttrib_DEFINITELYWRITABLE_TypeID, lastColHeaderIdx);
}
catch(Exception e)
{
addAttributeToNode(
S_ATTRIB_NOT_SUPPORTED,
- m_ColAttrib_DEFINITLEYWRITEABLE_TypeID, lastColHeaderIdx);
+ m_ColAttrib_DEFINITELYWRITABLE_TypeID, lastColHeaderIdx);
}
try
@@ -637,8 +637,8 @@
m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_TABLE_NAME,
DTM.ATTRIBUTE_NODE);
m_ColAttrib_CASESENSITIVE_TypeID =
m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_CASESENSITIVE,
DTM.ATTRIBUTE_NODE);
- m_ColAttrib_DEFINITLEYWRITEABLE_TypeID =
- m_expandedNameTable.getExpandedTypeID(S_NAMESPACE,
S_DEFINITLEYWRITABLE, DTM.ATTRIBUTE_NODE);
+ m_ColAttrib_DEFINITELYWRITABLE_TypeID =
+ m_expandedNameTable.getExpandedTypeID(S_NAMESPACE,
S_DEFINITELYWRITABLE, DTM.ATTRIBUTE_NODE);
m_ColAttrib_ISNULLABLE_TypeID =
m_expandedNameTable.getExpandedTypeID(S_NAMESPACE, S_ISNULLABLE,
DTM.ATTRIBUTE_NODE);
m_ColAttrib_ISSIGNED_TypeID =
No revision
No revision
1.28.2.3 +1 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java
Index: ElemForEach.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java,v
retrieving revision 1.28.2.2
retrieving revision 1.28.2.3
diff -u -r1.28.2.2 -r1.28.2.3
--- ElemForEach.java 22 Oct 2002 14:52:35 -0000 1.28.2.2
+++ ElemForEach.java 21 Dec 2002 16:20:36 -0000 1.28.2.3
@@ -418,7 +418,7 @@
if ((child & DTMManager.IDENT_DTM_DEFAULT) != docID)
{
dtm = xctxt.getDTM(child);
- docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT;
+ docID = child & DTMManager.IDENT_DTM_DEFAULT;
}
//final int exNodeType = dtm.getExpandedTypeID(child);
No revision
No revision
1.8.10.5 +3 -3
xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Compile.java
Index: Compile.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Compile.java,v
retrieving revision 1.8.10.4
retrieving revision 1.8.10.5
diff -u -r1.8.10.4 -r1.8.10.5
--- Compile.java 5 Nov 2002 10:41:36 -0000 1.8.10.4
+++ Compile.java 21 Dec 2002 16:20:36 -0000 1.8.10.5
@@ -82,8 +82,8 @@
// Versioning numbers for the compiler -v option output
private static int VERSION_MAJOR = 1;
- private static int VERSION_MINOR = 2;
- private static int VERSION_DELTA = 1;
+ private static int VERSION_MINOR = 4;
+ private static int VERSION_DELTA = 0;
// This variable should be set to false to prevent any methods in this
No revision
No revision
1.19.6.7 +2 -2
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Mode.java
Index: Mode.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Mode.java,v
retrieving revision 1.19.6.6
retrieving revision 1.19.6.7
diff -u -r1.19.6.6 -r1.19.6.7
--- Mode.java 17 Dec 2002 19:06:26 -0000 1.19.6.6
+++ Mode.java 21 Dec 2002 16:20:36 -0000 1.19.6.7
@@ -425,7 +425,7 @@
_patternGroups[kernelType];
}
- if (patterns == null) {
+ if (patterns.size() == 0) {
patterns.addElement(pattern);
}
else {
1.14.2.7 +11 -1
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StepPattern.java
Index: StepPattern.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StepPattern.java,v
retrieving revision 1.14.2.6
retrieving revision 1.14.2.7
diff -u -r1.14.2.6 -r1.14.2.7
--- StepPattern.java 17 Dec 2002 19:06:26 -0000 1.14.2.6
+++ StepPattern.java 21 Dec 2002 16:20:36 -0000 1.14.2.7
@@ -89,6 +89,8 @@
private boolean _isEpsilon = false;
private int _contextCase;
+ private double _priority = Double.MAX_VALUE;
+
public StepPattern(int axis, int nodeType, Vector predicates) {
_axis = axis;
_nodeType = nodeType;
@@ -110,6 +112,10 @@
public int getNodeType() {
return _nodeType;
}
+
+ public void setPriority(double priority) {
+ _priority = priority;
+ }
public StepPattern getKernelPattern() {
return this;
@@ -129,6 +135,10 @@
}
public double getDefaultPriority() {
+ if (_priority != Double.MAX_VALUE) {
+ return _priority;
+ }
+
if (hasPredicates()) {
return 0.5;
}
1.33.10.5 +86 -14
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup
Index: xpath.cup
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup,v
retrieving revision 1.33.10.4
retrieving revision 1.33.10.5
diff -u -r1.33.10.4 -r1.33.10.5
--- xpath.cup 5 Nov 2002 10:41:39 -0000 1.33.10.4
+++ xpath.cup 21 Dec 2002 16:20:36 -0000 1.33.10.5
@@ -130,6 +130,84 @@
_xsltc.setCallsNodeset(flag);
}
+ /**
+ * This method is similar to findNodeType(int, Object) except that it
+ * creates a StepPattern instead of just returning a node type. It also
+ * differs in the way it handles "{uri}:*" and "{uri}:@*". The last two
+ * patterns are expanded as "*[namespace-uri() = 'uri']" and
+ * "@*[namespace-uri() = 'uri']", respectively. This expansion
considerably
+ * simplifies the grouping of patterns in the Mode class. For this
+ * expansion to be correct, the priority of the pattern/template must be
+ * set to -0.25 (when no other predicates are present).
+ */
+ public StepPattern createStepPattern(int axis, Object test, Vector
predicates) {
+ int nodeType;
+
+ if (test == null) { // "*"
+ nodeType = (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE :
+ (axis == Axis.NAMESPACE) ? -1 : NodeTest.ELEMENT;
+
+ return new StepPattern(axis, nodeType, predicates);
+ }
+ else if (test instanceof Integer) {
+ nodeType = ((Integer) test).intValue();
+
+ return new StepPattern(axis, nodeType, predicates);
+ }
+ else {
+ QName name = (QName)test;
+ boolean setPriority = false;
+
+ if (axis == Axis.NAMESPACE) {
+ nodeType = (name.toString().equals("*")) ? -1
+ : _xsltc.registerNamespace(name);
+ }
+ else {
+ final String uri = name.getNamespace();
+ final String local = name.getLocalPart();
+ final QName namespace_uri =
+ _parser.getQNameIgnoreDefaultNs("namespace-uri");
+
+ // Expand {uri}:* to *[namespace-uri() = 'uri'] - same for @*
+ if (uri != null && (local.equals("*") || local.equals("@*"))) {
+ if (predicates == null) {
+ predicates = new Vector(2);
+ }
+
+ // Priority is set by hand if no other predicates exist
+ setPriority = (predicates.size() == 0);
+
+ predicates.add(
+ new Predicate(
+ new EqualityExpr(Operators.EQ,
+ new NamespaceUriCall(namespace_uri),
+ new LiteralExpr(uri))));
+ }
+
+ if (local.equals("*")) {
+ nodeType = (axis == Axis.ATTRIBUTE) ? NodeTest.ATTRIBUTE
+ : NodeTest.ELEMENT;
+ }
+ else if (local.equals("@*")) {
+ nodeType = NodeTest.ATTRIBUTE;
+ }
+ else {
+ nodeType = (axis == Axis.ATTRIBUTE) ?
_xsltc.registerAttribute(name)
+ : _xsltc.registerElement(name);
+ }
+ }
+
+ final StepPattern result = new StepPattern(axis, nodeType,
predicates);
+
+ // Set priority for case prefix:* and prefix:@* (no predicates)
+ if (setPriority) {
+ result.setPriority(-0.25);
+ }
+
+ return result;
+ }
+ }
+
public int findNodeType(int axis, Object test) {
if (test == null) { // *
return (axis == Axis.ATTRIBUTE) ?
@@ -354,16 +432,12 @@
StepPattern ::= NodeTestPattern:nt
{:
- final int nodeType = parser.findNodeType(Axis.CHILD, nt);
- RESULT = new StepPattern(
- (nodeType == NodeTest.ATTRIBUTE) ? Axis.ATTRIBUTE :
Axis.CHILD,
- nodeType, null);
+ RESULT = parser.createStepPattern(Axis.CHILD, nt, null);
:}
| NodeTestPattern:nt Predicates:pp
- {: RESULT = new StepPattern(Axis.CHILD,
- parser.findNodeType(Axis.CHILD, nt),
- pp);
+ {:
+ RESULT = parser.createStepPattern(Axis.CHILD, nt, pp);
:}
| ProcessingInstructionPattern:pip
@@ -373,16 +447,14 @@
{: RESULT = (ProcessingInstructionPattern)pip.setPredicates(pp);
:}
| ChildOrAttributeAxisSpecifier:axis NodeTestPattern:nt
- {: RESULT=new StepPattern(axis.intValue(),
- parser.findNodeType(axis.intValue(),
nt),
- null);
+ {:
+ RESULT = parser.createStepPattern(axis.intValue(), nt, null);
:}
| ChildOrAttributeAxisSpecifier:axis
NodeTestPattern:nt Predicates:pp
- {: RESULT = new StepPattern(axis.intValue(),
-
parser.findNodeType(axis.intValue(),nt),
- pp);
+ {:
+ RESULT = parser.createStepPattern(axis.intValue(), nt, pp);
:}
| ChildOrAttributeAxisSpecifier:axis
ProcessingInstructionPattern:pip
No revision
No revision
1.4.12.1 +2 -2 xml-xalan/java/src/org/apache/xml/dtm/DTMIterator.java
Index: DTMIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/DTMIterator.java,v
retrieving revision 1.4
retrieving revision 1.4.12.1
diff -u -r1.4 -r1.4.12.1
--- DTMIterator.java 7 Aug 2001 19:16:42 -0000 1.4
+++ DTMIterator.java 21 Dec 2002 16:20:36 -0000 1.4.12.1
@@ -206,7 +206,7 @@
* is rejected by the filters) the first node within its subtree which is
* not filtered out.
* @return The next node handle in the set being iterated over, or
- * -1 if there are no more members in that set.
+ * <code>DTM.NULL</code> if there are no more members in that set.
*/
public int nextNode();
@@ -214,7 +214,7 @@
* Returns the previous node in the set and moves the position of the
* <code>DTMIterator</code> backwards in the set.
* @return The previous node handle in the set being iterated over,
- * or <code>null</code> if there are no more members in that set.
+ * or <code>DTM.NULL</code> if there are no more members in that set.
*/
public int previousNode();
No revision
No revision
1.1.2.2 +3 -0
xml-xalan/java/src/org/apache/xml/dtm/ref/Attic/DTMChildIterNodeList.java
Index: DTMChildIterNodeList.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/Attic/DTMChildIterNodeList.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DTMChildIterNodeList.java 5 Nov 2002 10:32:26 -0000 1.1.2.1
+++ DTMChildIterNodeList.java 21 Dec 2002 16:20:37 -0000 1.1.2.2
@@ -133,6 +133,9 @@
while(--index>=0 && handle!=DTM.NULL) {
handle=m_parentDTM.getNextSibling(handle);
}
+ if (handle == DTM.NULL) {
+ return null;
+ }
return m_parentDTM.getNode(handle);
}
1.28.2.9 +2 -1
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java
Index: DTMDefaultBase.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java,v
retrieving revision 1.28.2.8
retrieving revision 1.28.2.9
diff -u -r1.28.2.8 -r1.28.2.9
--- DTMDefaultBase.java 21 Dec 2002 10:24:51 -0000 1.28.2.8
+++ DTMDefaultBase.java 21 Dec 2002 16:20:37 -0000 1.28.2.9
@@ -997,7 +997,7 @@
for (firstChild = _firstch(makeNodeIdentity(nodeHandle));
firstChild != DTM.NULL;
firstChild = _nextsib(firstChild)) {
- if (_exptype(firstChild) == nodeType) {
+ if (_exptype(firstChild) == nodeType) {
return makeNodeHandle(firstChild);
}
}
@@ -1916,6 +1916,7 @@
}
/**
+ * <meta name="usage" content="internal"/>
* Return the name of the character encoding scheme
* in which the document entity is expressed.
*
1.4.14.1 +3 -1
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeIterator.java
Index: DTMNodeIterator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeIterator.java,v
retrieving revision 1.4
retrieving revision 1.4.14.1
diff -u -r1.4 -r1.4.14.1
--- DTMNodeIterator.java 15 Jun 2001 17:54:12 -0000 1.4
+++ DTMNodeIterator.java 21 Dec 2002 16:20:37 -0000 1.4.14.1
@@ -193,7 +193,7 @@
throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
int handle=dtm_iter.nextNode();
- if (handle==-1)
+ if (handle==DTM.NULL)
return null;
return dtm_iter.getDTM(handle).getNode(handle);
}
@@ -211,6 +211,8 @@
throw new DTMDOMException(DOMException.INVALID_STATE_ERR);
int handle=dtm_iter.previousNode();
+ if (handle==DTM.NULL)
+ return null;
return dtm_iter.getDTM(handle).getNode(handle);
}
}
1.5.12.4 +3 -0
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeList.java
Index: DTMNodeList.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeList.java,v
retrieving revision 1.5.12.3
retrieving revision 1.5.12.4
diff -u -r1.5.12.3 -r1.5.12.4
--- DTMNodeList.java 13 Nov 2002 18:37:00 -0000 1.5.12.3
+++ DTMNodeList.java 21 Dec 2002 16:20:37 -0000 1.5.12.4
@@ -143,6 +143,9 @@
{
if (m_iter != null) {
int handle=m_iter.item(index);
+ if (handle == DTM.NULL) {
+ return null;
+ }
return m_iter.getDTM(handle).getNode(handle);
} else {
return null;
No revision
No revision
1.28.2.11 +12 -1
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
Index: SAX2DTM.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
retrieving revision 1.28.2.10
retrieving revision 1.28.2.11
diff -u -r1.28.2.10 -r1.28.2.11
--- SAX2DTM.java 21 Dec 2002 10:25:02 -0000 1.28.2.10
+++ SAX2DTM.java 21 Dec 2002 16:20:37 -0000 1.28.2.11
@@ -157,6 +157,9 @@
/** The SAX Document locator */
transient private Locator m_locator = null;
+ /** The SAX Document system-id */
+ transient private String m_systemId = null;
+
/** We are inside the DTD. This is used for ignoring comments. */
transient private boolean m_insideDTD = false;
@@ -934,7 +937,7 @@
// building the document.
if (m_sourceSystemId.size() != m_size) {
System.err.println("CODING ERROR in Source Location: " + m_size
- + " != "
+ + " != "
+ m_sourceSystemId.size());
System.exit(1);
}
@@ -1622,6 +1625,7 @@
public void setDocumentLocator(Locator locator)
{
m_locator = locator;
+ m_systemId = locator.getSystemId();
}
/**
@@ -1674,6 +1678,9 @@
m_contextIndexes = null;
m_endDocumentOccured = true;
+
+ // Bugzilla 4858: throw away m_locator. we cache m_systemId
+ m_locator = null;
}
/**
@@ -2447,6 +2454,10 @@
else if(m_locator!=null)
{
return new NodeLocator(null,m_locator.getSystemId(),-1,-1);
+ }
+ else if(m_systemId!=null)
+ {
+ return new NodeLocator(null,m_systemId,-1,-1);
}
return null;
}
No revision
No revision
1.9.10.2 +2 -2 xml-xalan/java/src/org/apache/xpath/NodeSetDTM.java
Index: NodeSetDTM.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/NodeSetDTM.java,v
retrieving revision 1.9.10.1
retrieving revision 1.9.10.2
diff -u -r1.9.10.1 -r1.9.10.2
--- NodeSetDTM.java 29 Jul 2002 00:01:32 -0000 1.9.10.1
+++ NodeSetDTM.java 21 Dec 2002 16:20:37 -0000 1.9.10.2
@@ -419,7 +419,7 @@
* iterator in the set. After a DTMIterator is created, the first call
* to nextNode() returns the first node in the set.
* @return The next <code>Node</code> in the set being iterated over, or
- * <code>null</code> if there are no more members in that set.
+ * <code>DTM.NULL</code> if there are no more members in that set.
* @throws DOMException
* INVALID_STATE_ERR: Raised if this method is called after the
* <code>detach</code> method was invoked.
@@ -443,7 +443,7 @@
* Returns the previous node in the set and moves the position of the
* iterator backwards in the set.
* @return The previous <code>Node</code> in the set being iterated over,
- * or<code>null</code> if there are no more members in that set.
+ * or<code>DTM.NULL</code> if there are no more members in that set.
* @throws DOMException
* INVALID_STATE_ERR: Raised if this method is called after the
* <code>detach</code> method was invoked.
No revision
No revision
1.53.2.5 +182 -11 xml-xalan/test/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xalan/test/build.xml,v
retrieving revision 1.53.2.4
retrieving revision 1.53.2.5
diff -u -r1.53.2.4 -r1.53.2.5
--- build.xml 26 Nov 2002 20:26:27 -0000 1.53.2.4
+++ build.xml 21 Dec 2002 16:20:38 -0000 1.53.2.5
@@ -36,6 +36,8 @@
<!-- Then, read in the default checked-in properties -->
<property file="test.properties" />
+ <property name="smoketest.conf.excludes"
value="${smoketest.conf.normal.excludes};${smoketest.conf.supplemental.excludes}"/>
+ <property name="smoketest.xsltc.conf.excludes"
value="${smoketest.xsltc.conf.normal.excludes};${smoketest.xsltc.conf.supplemental.excludes}"/>
<!-- Also provide environment properties with a special prefix which
allows us to detect if JARDIR is set.
-->
@@ -260,21 +262,23 @@
bootclasspathref="boot.class.path"
fork="${fork-tests}"
failonerror="${fail-on-error}" />
- <antcall target="scan">
- <param name="scan.outputDir" value="${conf.outputDir}"/>
- </antcall>
+ <property name="scan.outputDir" value="${conf.outputDir}"/>
+ <antcall target="scan"/>
</target>
+
<target name="conf.dom" description="Run TestletDriver over conf with
DOM excludes">
<antcall target="conf">
<param name="conf.excludes" value="${trax.dom.excludes}"/>
<param name="conf.flavor" value="trax.dom"/>
</antcall>
</target>
+
<target name="conf.one" description="Run a single conf test">
<antcall target="conf">
<param name="testClass"
value="org.apache.qetest.xsl.StylesheetDriver" />
</antcall>
</target>
+
<target name="conf.xsltc.dom" description="Run TestletDriver over conf
with DOM excludes">
<antcall target="conf.xsltc">
<param name="conf.xsltc.excludes" value="${trax.dom.excludes}"/>
@@ -282,6 +286,24 @@
</antcall>
</target>
+ <!-- ==================================================================
-->
+ <!-- Run tests: the normal StylesheetTestletDriver on the accept suite
-->
+ <!-- ==================================================================
-->
+ <target name="accept" description="Run TestletDriver over the accept
tree">
+ <echo message="Executing Xalan accept test." />
+ <property name="qetest.summaryFile" value="Accept.xml" />
+ <property name="testType" value="accept." />
+ <property name="scan.outputDir" value="${accept.outputDir}"/>
+ <antcall target="conf"/>
+ </target>
+
+ <target name="accept.xsltc" description="Run TestletDriver over the
accept tree">
+ <property name="testType" value="accept.xsltc." />
+ <property name="qetest.summaryFile" value="Accept.xml" />
+ <property name="scan.outputDir" value="${accept.xsltc.outputDir}"/>
+ <property name="use-processor" value="${accept.xsltc.processor}"/>
+ <antcall target="conf.xsltc" />
+ </target>
<!-- ==================================================================
-->
<!-- Run tests: the StylesheetErrorTestlet on the conferr suite
-->
@@ -474,6 +496,10 @@
description="Run the Xalan-J 2.x Smoketest"
depends="minitest-execute,extensions.classes,smoketest-execute,minitest-notpass,minitest-pass,smoketest-notpass,smoketest-pass">
</target>
+ <target name="smoketest.xsltc"
+ description="Run the Xalan-J 2.x XSLTC Smoketest"
+
depends="smoketest.xsltc-execute,smoketest.xsltc-notpass,smoketest.xsltc-pass">
+ </target>
<target name="smoketest.dev"
description="Run the Xalan-J 2.x Smoketest with dependencies"
depends="jar,minitest-execute,extensions.classes,smoketest-execute,minitest-notpass,minitest-pass,smoketest-notpass,smoketest-pass">
@@ -499,6 +525,11 @@
<param name="testType" value="smoketest.conf."/>
</antcall>
+ <echo message="About to execute Accept tests..." />
+ <antcall target="accept">
+ <param name="testType" value="smoketest.accept."/>
+ </antcall>
+
<echo message="About to execute other API tests..." />
<antcall target="api">
<param name="testClass"
value="org.apache.qetest.xsl.XSLTestHarness"/>
@@ -513,6 +544,7 @@
<condition property="smoketest-passed">
<and>
<available file="${smoketest.conf.passFile}" />
+ <available file="${smoketest.accept.passFile}" />
<available file="${smoketest.api.passFile}" />
<available file="${smoketest.extensions.passFile}" />
</and>
@@ -522,6 +554,28 @@
</antcall>
</target>
+ <target name="smoketest.xsltc-execute">
+ <echo message="About to execute Conformance tests..." />
+ <antcall target="conf.xsltc">
+ <param name="testType" value="smoketest.xsltc.conf."/>
+ </antcall>
+
+ <echo message="About to execute Accept tests..." />
+ <antcall target="accept.xsltc">
+ <param name="testType" value="smoketest.xsltc.accept."/>
+ </antcall>
+
+ <condition property="smoketest.xsltc-passed">
+ <and>
+ <available file="${smoketest.xsltc.conf.passFile}" />
+ <available file="${smoketest.xsltc.accept.passFile}" />
+ </and>
+ </condition>
+ <antcall target="scan">
+ <param name="scan.outputDir" value="smoketest.xsltc"/>
+ </antcall>
+ </target>
+
<target name="smoketest-notpass" unless="smoketest-passed">
<echo message=" [minitest] ERROR! The Smoketest failed!" />
<echo message=" [minitest] See details in ${smoketest.conf.logFile},
output is in ${smoketest.conf.outputDir}" />
@@ -535,6 +589,18 @@
<echo message=" [minitest] Details are in ${smoketest.conf.logFile},
${smoketest.api.logFile}, ${smoketest.extensions.logFile}" />
</target>
+ <target name="smoketest.xsltc-notpass" unless="smoketest.xsltc-passed">
+ <echo message=" [minitest] ERROR! The Smoketest failed!" />
+ <echo message=" [minitest] See details in
${smoketest.xsltc.conf.logFile}, output is in
${smoketest.xsltc.conf.outputDir}" />
+ <echo message=" [minitest] See details in
${smoketest.xsltc.accept.logFile}, output is in
${smoketest.xsltc.accept.outputDir}" />
+ <echo message=" [minitest] Please fix any smoketest problems before
checking in!" />
+ <fail message="Please fix any smoketest problems before checking
in!" />
+ </target>
+ <target name="smoketest.xsltc-pass" if="smoketest.xsltc-passed">
+ <echo message=" [minitest] CONGRATULATIONS! The Smoketest passed!" />
+ <echo message=" [minitest] Details are in ${smoketest.conf.logFile},
${smoketest.accept.logFile}" />
+ </target>
+
<target name="smoketest-results-dist" depends="init.test">
<property name="tarzip-backref" value="../.."/>
<property name="tarzip-fwdref" value="xml-xalan/test"/>
@@ -561,7 +627,7 @@
<!-- ==================================================================
-->
<target name="alltest"
description="Run nearly *all* available Xalan-J 2.x tests with
defaults"
- depends="all,alltest.other,alltest.conf,alltest.contrib">
+
depends="all,alltest.other,alltest.conf,alltest.accept,alltest.contrib">
<!-- Ensure that one last scan gets run of the whole output set
(Note that when we call sub-targets, some of our subdirs
may have had sub-scans done as well) -->
@@ -736,6 +802,59 @@
</antcall>
</target>
+ <target name="alltest.accept">
+ <property name="alltest.resultDir" value="results-alltest" />
+ <property name="alltest.accept.resultDir"
value="${alltest.resultDir}/accept" />
+ <echo message="About to execute accept tests with all flavors,
results into ${alltest.accept.resultDir}/..." />
+ <!-- Run full accept test with each major available flavor into
+ specific output directories; note any user options will
+ override for all test calls.
+ Also exclude the currently failing tests in the
+ smoketest if use.excludes is set.
+ -->
+ <condition property="accept.excludes"
value="${smoketest.accept.excludes}">
+ <equals arg1="${use.excludes}" arg2="true" />
+ </condition>
+ <antcall target="accept">
+ <param name="accept.flavor" value="trax.systemId"/>
+ <param name="accept.excludes" value="${accept.excludes}"/>
+ <param name="accept.outputDir"
value="${alltest.accept.resultDir}/systemId"/>
+ <param name="accept.logFile"
value="${alltest.accept.resultDir}/systemId/results.xml"/>
+ </antcall>
+ <antcall target="accept">
+ <param name="accept.flavor" value="trax.file"/>
+ <param name="accept.excludes" value="${accept.excludes}"/>
+ <param name="accept.outputDir"
value="${alltest.accept.resultDir}/file"/>
+ <param name="accept.logFile"
value="${alltest.accept.resultDir}/file/results.xml"/>
+ </antcall>
+ <antcall target="accept">
+ <param name="accept.flavor" value="trax.dom"/>
+ <!-- Note DOM always has additional exclusions in accept tests-->
+ <param name="accept.excludes"
value="${trax.dom.excludes};${accept.excludes}"/>
+ <param name="accept.outputDir"
value="${alltest.accept.resultDir}/dom"/>
+ <param name="accept.logFile"
value="${alltest.accept.resultDir}/dom/results.xml"/>
+ </antcall>
+ <antcall target="accept">
+ <param name="accept.flavor" value="trax.sax"/>
+ <param name="accept.excludes" value="${accept.excludes}"/>
+ <param name="accept.outputDir"
value="${alltest.accept.resultDir}/sax"/>
+ <param name="accept.logFile"
value="${alltest.accept.resultDir}/sax/results.xml"/>
+ </antcall>
+ <antcall target="accept">
+ <param name="accept.flavor" value="trax.localPath"/>
+ <param name="accept.excludes" value="${accept.excludes}"/>
+ <param name="accept.outputDir"
value="${alltest.accept.resultDir}/localPath"/>
+ <param name="accept.logFile"
value="${alltest.accept.resultDir}/localPath/results.xml"/>
+ </antcall>
+ <antcall target="accept">
+ <param name="accept.flavor" value="trax.stream"/>
+ <param name="accept.excludes" value="${accept.excludes}"/>
+ <param name="accept.outputDir"
value="${alltest.accept.resultDir}/stream"/>
+ <param name="accept.logFile"
value="${alltest.accept.resultDir}/stream/results.xml"/>
+ </antcall>
+ <!-- we should really run accept with each flavor -->
+ </target>
+
<target name="alltest.conf.xsltc">
<property name="alltest.xsltc.resultDir"
value="results-alltest.xsltc" />
<property name="alltest.conf.xsltc.resultDir"
value="${alltest.xsltc.resultDir}/conf" />
@@ -788,6 +907,60 @@
</antcall>
</target>
+ <target name="alltest.accept.xsltc">
+ <property name="alltest.xsltc.resultDir"
value="results-alltest.xsltc" />
+ <property name="alltest.accept.xsltc.resultDir"
value="${alltest.xsltc.resultDir}/accept" />
+ <echo message="About to execute xsltc.accept tests with all flavors,
results into ${alltest.accept.xsltc.resultDir}/..." />
+ <!-- Run full accept test with each major available flavor into
+ specific output directories; note any user options will
+ override for all test calls.
+ Also exclude the currently failing tests in the
+ smoketest if use.excludes is set.
+ -->
+ <condition property="accept.xsltc.excludes"
value="${smoketest.accept.xsltc.excludes}">
+ <equals arg1="${use.excludes}" arg2="true" />
+ </condition>
+ <antcall target="accept.xsltc">
+ <param name="accept.xsltc.flavor" value="trax.systemId"/>
+ <param name="accept.xsltc.excludes"
value="${accept.xsltc.excludes}"/>
+ <param name="accept.xsltc.outputDir"
value="${alltest.accept.xsltc.resultDir}/systemId"/>
+ <param name="accept.xsltc.logFile"
value="${alltest.accept.xsltc.resultDir}/systemId/results.xml"/>
+ </antcall>
+ <antcall target="accept.xsltc">
+ <param name="accept.xsltc.flavor" value="trax.file"/>
+ <param name="accept.xsltc.excludes"
value="${accept.xsltc.excludes}"/>
+ <param name="accept.xsltc.outputDir"
value="${alltest.accept.xsltc.resultDir}/file"/>
+ <param name="accept.xsltc.logFile"
value="${alltest.accept.xsltc.resultDir}/file/results.xml"/>
+ </antcall>
+ <antcall target="accept.xsltc">
+ <param name="accept.xsltc.flavor" value="trax.dom"/>
+ <!-- Note DOM always has additional exclusions in accept tests-->
+ <param name="accept.xsltc.excludes"
value="${trax.dom.excludes};${accept.xsltc.excludes}"/>
+ <param name="accept.xsltc.outputDir"
value="${alltest.accept.xsltc.resultDir}/dom"/>
+ <param name="accept.xsltc.logFile"
value="${alltest.accept.xsltc.resultDir}/dom/results.xml"/>
+ </antcall>
+ <antcall target="accept.xsltc">
+ <param name="accept.xsltc.flavor" value="trax.sax"/>
+ <param name="accept.xsltc.excludes"
value="${accept.xsltc.excludes}"/>
+ <param name="accept.xsltc.outputDir"
value="${alltest.accept.xsltc.resultDir}/sax"/>
+ <param name="accept.xsltc.logFile"
value="${alltest.accept.xsltc.resultDir}/sax/results.xml"/>
+ </antcall>
+ <antcall target="accept.xsltc">
+ <param name="accept.xsltc.flavor" value="trax.localPath"/>
+ <param name="accept.xsltc.excludes"
value="${accept.xsltc.excludes}"/>
+ <param name="accept.xsltc.outputDir"
value="${alltest.accept.xsltc.resultDir}/localPath"/>
+ <param name="accept.xsltc.logFile"
value="${alltest.accept.xsltc.resultDir}/localPath/results.xml"/>
+ </antcall>
+ <antcall target="accept.xsltc">
+ <param name="accept.xsltc.flavor" value="trax.stream"/>
+ <param name="accept.xsltc.excludes"
value="${accept.xsltc.excludes}"/>
+ <param name="accept.xsltc.outputDir"
value="${alltest.accept.xsltc.resultDir}/stream"/>
+ <param name="accept.xsltc.logFile"
value="${alltest.accept.xsltc.resultDir}/stream/results.xml"/>
+ </antcall>
+ </target>
+
+
+
<target name="test"
depends="alltest"
@@ -1176,8 +1349,7 @@
<!-- Special: allow explicit test.properties overrides for inputDir,
etc for xsltc -->
<property name="testType" value="conf.xsltc." />
<!-- Set indent-number to 0 to match Xalan's default indentation -->
- <property name="conf.xsltc.Processor.setAttribute.indent-number"
value="0"/>
-
+ <property name="${testType}Processor.setAttribute.indent-number"
value="0"/>
<xalantest test="${testClass}"
testType="${testType}"
classpathref="xsltc.runtime.class.path"
@@ -1187,9 +1359,8 @@
<!-- Explicitly set TransformerFactory property to use xsltc -->
<sysproperty key="javax.xml.transform.TransformerFactory"
value="org.apache.xalan.xsltc.trax.TransformerFactoryImpl"/>
</xalantest>
- <antcall target="scan">
- <param name="scan.outputDir" value="${conf.xsltc.outputDir}"/>
- </antcall>
+ <property name="scan.outputDir" value="${conf.xsltc.outputDir}"/>
+ <antcall target="scan" />
</target>
<target name="perf.xsltc" description="Run TestletDriver over the perf
tree using xsltc">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]