db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Russell <douglas.russ...@comlab.ox.ac.uk>
Subject Re: Derby XMLQUERY XPATH
Date Thu, 21 Jun 2007 14:40:03 GMT
I tried:

statement.execute(
                "SELECT ID, " +
                        "XMLSERIALIZE( " +
                                "XMLQUERY(' 
xmlns:myns=\"http://www.myproject.ox.ac.uk/MyProject\" //myns:Name' PASSING 
BY REF Definition EMPTY ON EMPTY) " +
                        "AS VARCHAR(10000)) " +
                        "FROM My_Schema.My_Table");

Same error:
Caused by: org.apache.derby.client.am.SqlException: Encountered error while 
evaluating XML query expression for XMLQUERY operator: Prefix must resolve to 
a namespace: myns SQLSTATE: XJ001: Java exception: 'Prefix must resolve to a 
namespace: myns: org.apache.xpath.domapi.XPathStylesheetDOM3Exception'.

Cheers

On Thursday 21 Jun 2007, Bryan Pendleton wrote:
> > I've tried:
> > '//myns:Name' and that would seem to be correct, but I can find no way of
> > setting myns to resolve to "http://www.myproject.ox.ac.uk/MyProject" in
>
> Did you try including
>
>    xmlns:myns="http://www.myproject.ox.ac.uk/MyProject"
>
> in your XQuery expression?
>
> I don't know if it will work, but it's worth a try.
>
> thanks,
>
> bryan



-- 
Douglas PW Russell
Research Officer - GIMI/NeuroGrid
Oxford University Computing Laboratory
Tel:	+44 (0)1865 283519
email:	douglas.russell@comlab.ox.ac.uk

Mime
View raw message