From: Wolfgang M. M. <wol...@us...> - 2006-01-15 13:32:53
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5752/src/org/exist/xquery/value Modified Files: Sequence.java AtomicValue.java PreorderedValueSequence.java NodeValue.java AbstractSequence.java Log Message: New design for predicate processing: to distinguish different contexts when processing nested predicate expressions, we store the predicate's expression id along with each context node. This fixes problems like bug #1400246: //a[preceding-sibling::*[1]/s = "B"] used to return 3 results instead of one. Index: PreorderedValueSequence.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/PreorderedValueSequence.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PreorderedValueSequence.java 14 Jan 2006 13:06:46 -0000 1.7 --- PreorderedValueSequence.java 15 Jan 2006 13:32:43 -0000 1.8 *************** *** 49,53 **** private OrderedNodeProxy[] nodes; ! public PreorderedValueSequence(OrderSpec specs[], Sequence input) throws XPathException { this.orderSpecs = specs; nodes = new OrderedNodeProxy[input.getLength()]; --- 49,53 ---- private OrderedNodeProxy[] nodes; ! public PreorderedValueSequence(OrderSpec specs[], Sequence input, int contextId) throws XPathException { this.orderSpecs = specs; nodes = new OrderedNodeProxy[input.getLength()]; *************** *** 56,60 **** NodeProxy p = (NodeProxy)i.nextItem(); nodes[j] = new OrderedNodeProxy(p); ! p.addContextNode(nodes[j]); } processAll(); --- 56,60 ---- NodeProxy p = (NodeProxy)i.nextItem(); nodes[j] = new OrderedNodeProxy(p); ! p.addContextNode(contextId, nodes[j]); } processAll(); Index: AtomicValue.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/AtomicValue.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AtomicValue.java 7 Jan 2006 21:47:11 -0000 1.16 --- AtomicValue.java 15 Jan 2006 13:32:43 -0000 1.17 *************** *** 286,290 **** * @see org.exist.xquery.value.Sequence#setSelfAsContext() */ ! public void setSelfAsContext() { } --- 286,290 ---- * @see org.exist.xquery.value.Sequence#setSelfAsContext() */ ! public void setSelfAsContext(int contextId) { } Index: AbstractSequence.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/AbstractSequence.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AbstractSequence.java 7 Jan 2006 21:47:11 -0000 1.16 --- AbstractSequence.java 15 Jan 2006 13:32:43 -0000 1.17 *************** *** 208,212 **** } ! public void setSelfAsContext() { Item next; NodeValue node; --- 208,212 ---- } ! public void setSelfAsContext(int contextId) { Item next; NodeValue node; *************** *** 215,219 **** if(Type.subTypeOf(next.getType(), Type.NODE)) { node = (NodeValue) next; ! node.addContextNode(node); } } --- 215,219 ---- if(Type.subTypeOf(next.getType(), Type.NODE)) { node = (NodeValue) next; ! node.addContextNode(contextId, node); } } Index: NodeValue.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/NodeValue.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NodeValue.java 7 Jan 2006 21:47:11 -0000 1.5 --- NodeValue.java 15 Jan 2006 13:32:43 -0000 1.6 *************** *** 79,83 **** public int getImplementationType(); ! public void addContextNode(NodeValue node); public Node getNode(); --- 79,83 ---- public int getImplementationType(); ! public void addContextNode(int contextId, NodeValue node); public Node getNode(); Index: Sequence.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/Sequence.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Sequence.java 7 Jan 2006 21:47:11 -0000 1.9 --- Sequence.java 15 Jan 2006 13:32:43 -0000 1.10 *************** *** 209,213 **** public void clearContext(); ! public void setSelfAsContext(); public boolean isPersistentSet(); --- 209,213 ---- public void clearContext(); ! public void setSelfAsContext(int contextId); public boolean isPersistentSet(); |