Update of /cvsroot/monetdb/pathfinder/runtime/xrpc/demo
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24415

Modified Files:
      Tag: xrpcdemo
        index.html 
Added Files:
      Tag: xrpcdemo
        demo-xrpcmod.xq 
Log Message:
forgot to add the new module file



U index.html
Index: index.html
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/xrpc/demo/Attic/index.html,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -d -r1.1.2.10 -r1.1.2.11
--- index.html  11 Jun 2008 23:47:33 -0000      1.1.2.10
+++ index.html  12 Jun 2008 01:22:50 -0000      1.1.2.11
@@ -72,7 +72,13 @@
       "declare function dfx:getPerson( \n" +
       "          $doc as xs:string, \n" +
       "          $pid as xs:string) as node() \n" +
-      "{ doc($doc)//person[./@id = $pid]; };");
+      "{ \n" +
+      "        for $p in doc($doc)//person[./@id = $pid] \n" +
+      "        return \n" +
+      "                element person { \n" +
+      "                        attribute id {$p/@id}, \n" +
+      "                        $p/name } \n" +
+      "}; \n");
 
   funcdefs[funcdefs.length]=new funcdef("auctionsAllPerson", false,
       new Array("string", "string"), new Array("", ""),

--- NEW FILE: demo-xrpcmod.xq ---
module namespace dfx="demo-functions-xrpc";

import module namespace f2 = "demo-functions"
                at "http://localhost:50001/demo/demo-mod.xq";;

declare function dfx:getPerson(
          $doc as xs:string,
          $pid as xs:string) as node()*
{
        for $p in doc($doc)//person[./@id = $pid]
        return
                element person {
                        attribute id {$p/@id},
                        $p/name }
};

(:
declare function dfx:auctionsByPerson(
          $doc as xs:string,
          $pid as xs:string) as node()*
{
  for $ca in doc($doc)//closed_auction[./buyer/@person=$pid]
  return
    element closed_auction {
      attribute buyer {$ca/buyer/@person},
      $ca/price
    }
};
:)

declare function dfx:auctionsAllPerson(
                        $dst as xs:string,
                        $doc as xs:string) as node()*
{ 
        for $pid in doc($doc)//person/@id
        return  
                execute at {$dst} {f2:auctionsByPerson($doc, $pid)}
};

declare function dfx:nestedRPC(
          $dst1 as xs:string,
          $dst2 as xs:string,
          $dst3 as xs:string,
          $doc as xs:string) as node()*
{
  (execute at {$dst1} {dfx:auctionsAllPerson($dst3, $doc)},
   execute at {$dst2} {dfx:auctionsAllPerson($dst3, $doc)})
};

declare updating function dfx:insertPerson(
          $doc as xs:string,
          $p as node())
{
  do insert $p into doc($doc)//people
};

declare updating function dfx:insertPersonNested(
                        $dsts as xs:string+,
                        $doc as xs:string,
                        $p as node())
{
  (do insert $p into doc($doc)//people,
   for $dst in $dsts return
          execute at {$dst} {dfx:insertPerson($doc, $p)})
};

declare updating function dfx:deletePerson(
          $doc as xs:string,
          $pid as xs:string)
{
  do delete doc($doc)//person[./@pid=$pid]
};

declare updating function dfx:deletePersonNested(
                        $dsts as xs:string+,
                        $doc as xs:string,
                        $pid as xs:string)
{
  (do delete doc($doc)//person[./@pid=$pid],
   for $dst in $dsts return
          execute at {$dst} {dfx:deletePerson($doc, $pid)})
};

declare function dfx:getdoc($url as xs:string) as document-node()?
{ doc($url) };



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to