When I ran some XQuery code that calls Java, I came across a problem with
Java URLs being passed around in the query. Here is a small example:

        declare namespace url="java:java.net.URL";
        url:to-string(url:new("http://www.w3.org/TR/xquery/"))

This returns:

        The anyURI value '"http://www.w3.org/TR/xquery/"' is not an acceptable Java URL

with a call stack of

        at net.sf.saxon.expr.PJConverter$AnyURIValueToURL.convert(PJConverter.java:763)
        at net.sf.saxon.functions.ExtensionFunctionCall.getTargetInstance(ExtensionFunctionCall.java:400)
        at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:315)
        at net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctionCall.java:213)
        at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:352)
        at net.sf.saxon.expr.Expression.process(Expression.java:461)
        at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:393)
        at net.sf.saxon.Query.runQuery(Query.java:893)
        at net.sf.saxon.Query.doQuery(Query.java:235)
        at net.sf.saxon.Query.main(Query.java:112)

Best regards,
Gunther


 
Software AG – Sitz/Registered office: Uhlandstraße 12, 64297 Darmstadt, Germany, – Registergericht/Commercial register: Darmstadt HRB 1562 - Vorstand/ Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman), David Broadbent, Mark Edwards, Dr. Peter Kürpick,Arnd Zinnhardt; - Aufsichtsratsvorsitzender/ Chairman of the Supervisory Board: Frank F. Beelitz - http://www.softwareag.com