Project

Profile

Help

XQuery 3.0 maps and XQJ?

Added by Dino Fancellu over 11 years ago

I have this code:


setProperty("http://saxon.sf.net/feature/xqueryVersion", "3.0")

...

 xquery version "3.0";
 let $week := map{0:="Sonntag", 1:="Montag", 2:="Dienstag", 3:="Mittwoch", 4:="Donnerstag", 5:="Freitag", 6:="Samstag"}
		      
 return $week

However I get the following error from 9.5.1.1

Exception in thread "main" java.lang.ClassCastException: com.saxonica.functions.map.ImmutableMap cannot be cast to net.sf.saxon.om.NodeInfo at net.sf.saxon.xqj.StandardObjectConverter.toObject(StandardObjectConverter.java:151) at net.sf.saxon.xqj.SaxonXQItem.getObject(SaxonXQItem.java:257) at net.sf.saxon.xqj.SaxonXQForwardSequence.getObject(SaxonXQForwardSequence.java:112)

Am I doing something wrong?

Thanks.

Dino.


Replies (2)

XQuery 3.0 maps and XQJ? - Added by Dino Fancellu over 11 years ago

I understand that its not very surprising that XQJ 1.0 knows nothing of XQuery 3.0, was just hoping that it would map over to something usable.

Any idea if any work is being done to bring XQJ up to the new 3.0 world?

On 7 July 2013 12:42, Saxonica Developer Community < > wrote:

RE: XQuery 3.0 maps and XQJ? - Added by Michael Kay over 11 years ago

Unfortunately Oracle's licensing rules for XQJ are draconian about not allowing extensions. I've taken this literally, and have made no attempt to define the extensions to XQJ needed for it to support XQuery 3.0 facilities (let alone features like maps, which is technically a Saxon extension - it's an XSLT 3.0 facility grafted into XQuery).

I have no idea whether any work is planned on taking XQJ forward, but the last round of development was so slow, and so dominated by lawyers apparently determined to stop it happening at all, that I wouldn't hold my breath. Use s9api instead.

    (1-2/2)

    Please register to reply