|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] XQuery - Grammar? Implementations?Yoshi Okamoto yoshiokamoto at yahoo.comFri Jan 30 19:29:08 PST 2009
Dear XQuery subscribers, I am sometimes fighting to understand all the details of the XQuery grammar. If you have some time, I would be delighted if you could have a look at the following example: I have defined a function with a single string argument: [0] declare function local:f($a as xs:string) { $a }; If I pass on an element as follows: [1] let $a := <X>Y</X> return local:f($a) it is accepted by most XQuery implementations which I tried (I am testing with Saxon, BaseX, MonetDB, Zorba, Qizx, Kawa and MXQuery). However, when I cast the element before passing it on: [2] let $a as xs:string := <X>Y</X> return local:f($a) some implementations (also Saxon, which I regard as reference implementation) return [XPTY0004] as error. A third version with an explicit cast: [3] let $a := xs:string(<X>Y</X>) return local:f($a) is finally accepted by all implementations. If possible, can someone tell me what the difference are between the versions, especially [1] and [2]? I tried to find the answer in the specification, but I was not successful. Thank you very much for your attention and help! Best Regards, Yoshi Okamoto
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






