Hi,
I have a table with schema: (id varchar, event long xml). Using isql I
try the following query:
select xquery_eval('declare namespace vo="http://www.ivoa.net/xml/VOEvent/v1.1
" let $val:=vo:VOEvent[Citations/EventId = "ivo://gcn.gsfc/172767"]
return <events>{$val}</events>', event) from voevent..events;
which throws up this error:
/usr/local/virtuoso-opensource/bin/isql: get_next_token: Unknown macro
word "val:" at line 16 of Top-Level
/usr/local/virtuoso-opensource/bin/isql: get_next_token: Unknown macro
word "val" at line 16 of Top-Level
*** Error 37000: [Virtuoso Driver][Virtuoso Server]XM029: XQuery
interpreter, line 1: syntax error at vo
at line 16 of Top-Level:
select xquery_eval('namespace vo="http://www.ivoa.net/xml/VOEvent/
v1.1" let NULL=vo:VOEvent[Citations/EventId = "ivo://gcn.gsfc/172767"]
return <events>{NULL}</events>', event) from voevent..events
I've tried just doing 'namespace vo=...' and also putting a semicolon
after the namespace declaration but neither works. I'd use an XPath
statement if possible but this does not let you declare the namespace
- or is there a Virtuoso hack for this?
What am I doing wrong - I am using Virtuoso 5.0.3 on Mac 10.5.1.
Cheers,
Matthew