I agree this is a bug. The same should be done for numbers. Here's a
trivial patch (apply over the one by Robin).
Tom Kaiser

Index: expr.cpp
===================================================================
RCS file: d:/cvs-master/ga/src/Sablot/engine/expr.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -a -u -r1.2 -r1.3
--- expr.cpp    2000/07/26 09:50:48     1.2
+++ expr.cpp    2000/07/26 09:52:25     1.3
@@ -2323,13 +2323,15 @@
     Err(situation, ET_BAD_ARGS_N);
 #define checkArgsCountBetween(x,y) if ((atomsNumber < x) || \
     (atomsNumber > y)) Err(situation, ET_BAD_ARGS_N);
+
+// only check for being a nodeset
 #define checkIsNodeset(x) if (atoms[x] -> type != EX_NODESET)\
     Err(situation, ET_BAD_ARG_TYPE);
+
 // Everything is a string, in a cosmic sense
 #define checkIsString(x)
-#define checkIsString2(x,y)
-#define checkIsNumber(x) if (atoms[x] -> type != EX_NUMBER)\
-    Err(situation, ET_BAD_ARG_TYPE);
+#define checkIsString2(x,y) 
+#define checkIsNumber(x)
 
 /*................
 firstOccurence


[EMAIL PROTECTED] wrote:
> 
> On Tue, Jul 25, 2000 at 12:42:35PM -0400, Hammond, Daniel wrote:
> > http://www.w3.org/TR/xpath#section-Function-Calls
> > 3.2 Function Calls
> > A FunctionCall expression is evaluated by using the FunctionName to identify
> > a function in the expression evaluation context function library, evaluating
> > each of the Arguments, converting each argument to the type required by the
> > function, and finally calling the function, passing it the converted
> > arguments.
> 
> Okay, I think this patch fixes the string case.
> I haven't thought about numbers yet.
> 
> Index: ga/src/Sablot/engine/expr.cpp
> ===================================================================
> RCS file: /usr/local/cvs-master/ga/src/Sablot/engine/expr.cpp,v
> retrieving revision 1.5
> diff -u -r1.5 expr.cpp
> --- ga/src/Sablot/engine/expr.cpp       2000/07/17 15:42:16     1.5
> +++ ga/src/Sablot/engine/expr.cpp       2000/07/25 19:09:31
> @@ -2325,10 +2325,9 @@
>      (atomsNumber > y)) Err(situation, ET_BAD_ARGS_N);
>  #define checkIsNodeset(x) if (atoms[x] -> type != EX_NODESET)\
>      Err(situation, ET_BAD_ARG_TYPE);
> -#define checkIsString(x) if (atoms[x] -> type != EX_STRING)\
> -    Err(situation, ET_BAD_ARG_TYPE);
> -#define checkIsString2(x,y) if ((atoms[x] -> type != EX_STRING) || \
> -    (atoms[y] -> type != EX_STRING)) Err(situation, ET_BAD_ARG_TYPE);
> +// Everything is a string, in a cosmic sense
> +#define checkIsString(x)
> +#define checkIsString2(x,y)
>  #define checkIsNumber(x) if (atoms[x] -> type != EX_NUMBER)\
>      Err(situation, ET_BAD_ARG_TYPE);
> 
> 
>  .robin.
> 
> --
> A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!



Reply via email to