
On Mon, Feb 05, 2007 at 09:08:59PM +0100, Martijn Faassen wrote:
Hi there,
Just downloaded and installed the new release. Compiling and installing on my system went off without a hitch, my compliments.
I've been trying to use pathfinder's xquery's support and I ran into some snags. It may be something I do wrong, but I'll ask anyway.
First, I was testing the xquery support. I tried to shred a document like this:
shred_doc('/home/faassen/xml/shaks/hamlet.xml', 'hamlet')
and then to refer to this document from an xquery like this:
doc('hamlet')//FM
I get the following error:
MAPI = monetdb@localhost:50000 QUERY = doc('hamlet')//FM ERROR = !ERROR: [shred_url]: 1 times inserted nil due to errors at tuples 0@0. !ERROR: [shred_url]: first error was: !ERROR: shred: cannot stat `hamlet': No such file or directory !ERROR: CMDshred_url: operation failed. !ERROR: interpret_params: leftfetchjoin(param 2): evaluation error.
Hinted by the 'cannot stat', I tried the following:
Hi Martijn, It seems that the "shred_doc" operation did not succeed. Is the above line with "shred_doc" a literal copy of what you entered in Mserver? Then you need to add the ';' sign at the end of the line: shred_doc('/home/faassen/xml/shaks/hamlet.xml', 'hamlet'); Note that a MIL statement needs to be terminated by a ';' sign. Otherwise, Mserver will wait for more input. If "shred_doc" succeeded, you should get some information like the following: MonetDB>shred_doc("/ufs/zhang/xrpcdemo/hello.xml", "hello.xml"); # Elapsed time = 010ms 671us [002ms 667us/node] # Shredded 1 XML document (hello.xml), total time after commit=0.065s Regards, Jennie
doc('/home/faassen/xml/shaks/hamlet.xml')//FM
and this gets a step further (still wondering why the former didn't work, though):
MAPI = monetdb@localhost:50000 QUERY = doc('/home/faassen/xml/shaks/hamlet.xml')//FM ERROR = !ERROR: I/O warning : failed to load external entity "play.dtd" !ERROR: [shred_url]: 1 times inserted nil due to errors at tuples 0@0. !ERROR: [shred_url]: first error was: !ERROR: shred_external_subset: WARNING: xmlParseDTD("play.dtd") FAILED, NO ID/IDREF QUERIES !ERROR: shred_external_subset: NOTE : maybe using absolute filenames works, sorry! !ERROR: CMDshred_url: operation failed. !ERROR: interpret_params: leftfetchjoin(param 2): evaluation error.
The play.dtd is in the directory next to 'hamlet.xml', so don't know why that doesn't work either.
So, I made a new hamlet2.xml removing the dtd reference. I don't need dtd support anyway, but it'd be nice if it could parse documents with dtds, of course. Now, it works.
Next, I was trying out the xquery update support. Not hindered by any knowledge on how it works, I went to the referenced W3C document and adapted the first insert statement I saw there into this:
do insert <year>2005</year> after fn:doc('/home/faassen/xml/shaks/hamlet2.xml')/PLAY/TITLE
This however gives me an error message I do not understand:
MAPI = monetdb@localhost:50000 QUERY = do insert <year>2005</year> after fn:doc('/home/faassen/xml/shaks/hamlet2.xml')/PLAY/TITLE ERROR = !type error: no variant of function upd:insertAfter accepts the given argument type(s): element TITLE { item* }*; (node* | node)* !type error: maybe you meant: !type error: upd:insertAfter (node, node*) as stmt !type error: illegal arguments for function upd:insertAfter
What am I doing wrong there?
Regards,
Martijn
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers