path for XQueryContext.java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

path for XQueryContext.java

Евгений-8
This path for XQueryContext.java v. 1.63
Corrects  declaration of local variables.


Index: eXist-1.0/src/org/exist/xquery/XQueryContext.java
===================================================================
RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XQueryContext.java,v
retrieving revision 1.63
diff -u -r1.63 XQueryContext.java
--- eXist-1.0/src/org/exist/xquery/XQueryContext.java 21 Sep 2005 21:07:13 -0000 1.63
+++ eXist-1.0/src/org/exist/xquery/XQueryContext.java 24 Sep 2005 10:58:25 -0000
@@ -866,21 +866,27 @@
  * @throws XPathException if the variable is unknown
  */
  public Variable resolveVariable(QName qname) throws XPathException {
- Variable var;
+     Variable var;
+        
+ // check if the variable is declared local
  var = resolveLocalVariable(qname);
+        
  // check if the variable is declared in a module
-        Module module = getModule(qname.getNamespaceURI());
-        if(module != null) {
-            var = module.resolveVariable(qname);
-            if(var != null)
-                return var;
+ if (var == null){
+            Module module = getModule(qname.getNamespaceURI());
+            if(module != null)
+                var = module.resolveVariable(qname);
         }
+        
 // var = (Variable) variables.get(qname);
- if (var == null) {
+
+ // check if the variable is declared global
+ if (var == null)
  var = (Variable) globalVariables.get(qname);
- }
+
  if (var == null)
  throw new XPathException("variable $\"" + qname + "\" is not bound");
+        
  return var;
  }
 
Reply | Threaded
Open this post in threaded view
|

Re: path for XQueryContext.java

Jean-Marc Vanel-3
Евгений wrote:

> This path for XQueryContext.java v. 1.63
> Corrects  declaration of local variables.

Thanks Evgueni.
Could you provide some XQuery tests that were broken, and that are
corrected by your patch ?

--
Jean-Marc Vanel
Conseil et Services / développement & intégration logiciels
Logiciel libre, Web, Java, XML ...
A la pointe de la technique, au service des projets
http://jmvanel.free.fr/ ===) CV, software resources

Mes journaux:
- sujets généraux en Français: http://jmvanel.free.fr/Block-note.html
- sujets informatiques en Français: http://jmvanel.free.fr/notes-informatiques.html
- computer science diary : http://jmvanel.free.fr/computer-notes.html

Worldwide Botanical Knowledge Base
http://wwbota.free.fr/ 
test XML query engine: http://jmvanel.free.fr/protea.html




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open