logo       

Function signature: msg#00200

text.xml.exist

Subject: Function signature

I propose the following change to FunctionSignature.java:

Index: src/org/exist/xquery/FunctionSignature.java
===================================================================
RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/FunctionSignature.java,v

retrieving revision 1.1
diff -r1.1 FunctionSignature.java
88c88,95
< return arguments != null ? arguments.length : 0;
---
if (arguments == null || arguments.length == 0)
return 0;

int len = arguments.length;
if ((arguments[len - 1].getCardinality() & Cardinality.ZERO) ==
Cardinality.ZERO)
return len - 1;
else
return len;

which will correctly assess the number of required arguments in:

fn:blah($a as xs:string, $b as xs:string*)

(there is ONE required argument, not TWO).

I'll commit if there are no objections...


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise