Hi Arthur,

with PUT, your node is serialized to disk, in the file 
"<dbfarm>/<db>/tmp/test.xml"
it is not shredded at all, you can see this by using xmldb_print() in a
Msever console.  So the problem seems to be caused by that _del_doc does
not recognize a document that is stored on disk but not shredded...


Jennie


On Wed, Mar 07, 2007 at 09:18:31PM +0100, Arthur van Bunningen wrote:
> Dear All,
> 
> To  be able to create a soap-interface with support for the dynamic 
> management of xml documents I created a XQuery module with some simple 
> document management functions, which I stole from 
> "pathfinder/runtime/xrpc/admin/admin.xq" (the code is found at the end 
> of this mail).
> 
> To test the functions without soap, I created tree simple xqueries. Now 
> adding and displaying documents works perfectly. However, when I want to 
> delete a document I get: "ERROR = !ERROR: _del_doc(tmp/test.xml): 
> document not found in database (1 such errors)! !ERROR: 
> interpret_params: shred_doc_base(param 1): evaluation error.".
> 
> Maybe this is because the document is not shredded in an ordinary way, 
> however I do not know of any other function that can insert documents 
> without a physical location.
> 
> If someone could help me to delete these documents, or point me to 
> another way of inserting documents without a physical location (, or 
> show me the stupid mistake I made :) ), this would be very much appreciated.
> 
> Best regards,
> 
> Arthur
> 
> 
> 
> 
> The module looks as follows:
> ==========================
> module namespace cq = "http://db.cs.utwente.nl/cq#";;
> declare updating function cq:PUT($uri as xs:string, $doc as element())
> {
>   if (substring($uri, 1,4) = 'tmp/')
>   then put($doc, $uri)
>   else error('PUT: only relative URIs starting with tmp/ allowed')
> };
> 
> declare function cq:GET($uri as xs:string)
> { doc($uri) };
> 
> declare document management function cq:DELETE($uri as xs:string)
> {
>   if (substring($uri, 1,4) = 'tmp/')
>   then pf:del-doc($uri)
>   else error('DELETE: only relative URIs starting with tmp/ allowed')
> };
> 
> ==========================
> The three test files look as follows:
> ==========================
> import module namespace cq = "http://db.cs.utwente.nl/cq#"; at 
> "/home/db/bunninge/phd/implementation/xquery/try3_module/ca_module.xq";
> cq:PUT("tmp/test.xml",<bla/>)
> ==========================
> import module namespace cq = "http://db.cs.utwente.nl/cq#"; at 
> "/home/db/bunninge/phd/implementation/xquery/try3_module/ca_module.xq";
> cq:GET("tmp/test.xml")
> ==========================
> import module namespace cq = "http://db.cs.utwente.nl/cq#"; at 
> "/home/db/bunninge/phd/implementation/xquery/try3_module/ca_module.xq";
>  cq:DELETE("tmp/test.xml")
> 
> 
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> MonetDB-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/monetdb-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MonetDB-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-users

Reply via email to