From: Wolfgang M. M. <wol...@us...> - 2004-04-23 13:08:25
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2156/src/org/exist/xquery Modified Files: XQueryContext.java XPathException.java FunctionCall.java UserDefinedFunction.java Log Message: A large number of XUpdate bugs has been fixed. Index: UserDefinedFunction.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/UserDefinedFunction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UserDefinedFunction.java 29 Jan 2004 15:06:42 -0000 1.1 --- UserDefinedFunction.java 23 Apr 2004 13:07:46 -0000 1.2 *************** *** 42,46 **** private Sequence[] currentArguments = null; ! private boolean isReset = true; public UserDefinedFunction(XQueryContext context, FunctionSignature signature) { --- 42,46 ---- private Sequence[] currentArguments = null; ! private boolean isReset = false; public UserDefinedFunction(XQueryContext context, FunctionSignature signature) { *************** *** 81,86 **** context.declareVariable(var); } ! isReset = false; ! return body.eval(contextSequence, contextItem); } --- 81,86 ---- context.declareVariable(var); } ! Sequence result = body.eval(contextSequence, contextItem); ! return result; } *************** *** 115,123 **** */ public void resetState() { ! if(isReset) ! return; ! isReset = true; ! body.resetState(); ! } } --- 115,123 ---- */ public void resetState() { ! if(!isReset) { ! isReset = true; ! body.resetState(); ! isReset = false; ! } } } Index: XQueryContext.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XQueryContext.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** XQueryContext.java 14 Apr 2004 12:17:23 -0000 1.10 --- XQueryContext.java 23 Apr 2004 13:07:45 -0000 1.11 *************** *** 28,31 **** --- 28,32 ---- import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; + import java.net.URI; import java.net.URL; import java.util.HashMap; *************** *** 130,133 **** --- 131,136 ---- private Stack fragmentStack = new Stack(); + private Expression rootExpression; + public XQueryContext(DBBroker broker) { this.broker = broker; *************** *** 135,138 **** --- 138,149 ---- } + public void setRootExpression(Expression expr) { + this.rootExpression = expr; + } + + public Expression getRootExpression() { + return rootExpression; + } + /** * Declare a user-defined prefix/namespace mapping. *************** *** 700,704 **** throw new XPathException("cannot read module source from file at " + f.getAbsolutePath()); } ! location = f.toURI().toASCIIString(); } LOG.debug("Loading module from " + location); --- 711,718 ---- throw new XPathException("cannot read module source from file at " + f.getAbsolutePath()); } ! try { ! location = new URI(f.toURL().toString()).toASCIIString(); ! } catch (Exception e1) { ! } } LOG.debug("Loading module from " + location); Index: XPathException.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XPathException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XPathException.java 23 Feb 2004 09:36:11 -0000 1.3 --- XPathException.java 23 Apr 2004 13:07:46 -0000 1.4 *************** *** 47,54 **** public void setASTNode(XQueryAST ast) { - System.out.println(ast); this.astNode = ast; } /* (non-Javadoc) * @see java.lang.Throwable#getMessage() --- 47,57 ---- public void setASTNode(XQueryAST ast) { this.astNode = ast; } + public XQueryAST getASTNode() { + return astNode; + } + /* (non-Javadoc) * @see java.lang.Throwable#getMessage() Index: FunctionCall.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/FunctionCall.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FunctionCall.java 2 Mar 2004 12:51:15 -0000 1.2 --- FunctionCall.java 23 Apr 2004 13:07:46 -0000 1.3 *************** *** 111,115 **** return returnSeq; } catch(XPathException e) { ! e.setASTNode(getASTNode()); throw e; } finally { --- 111,116 ---- return returnSeq; } catch(XPathException e) { ! if(e.getASTNode() == null) ! e.setASTNode(getASTNode()); throw e; } finally { |