[Bug 3578] [UPDUseCases] Issues with May 8th Usecase Draft

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3578





------- Comment #1 from jonathan.robie@redhat.com  2007-08-17 17:18 -------
This seems to solve the address book use case - it sure would be easier with
the scripting extensions.

for $a in doc("archive.xml")/archived-agenda/entry,
   $v1 in doc("copy1.xml")/agenda-version/entry,
   $v2 in doc("copy2.xml")/agenda-version/entry
where $a/name = $v1/name
 and $v1/name = $v2/name
return
 if ($a/contact = $v1/contact and $v1/contact=$v2/contact)
 then ()
 else
   if ($v1/contact = $v2/contact)
   then replace value of node $a/contact with $v1/contact
   else
     if ($a/contact = $v1/contact)
     then (
           replace value of node $a/contact with $v2/contact,
           replace value of node $v1/contact with $v2/contact
           )
     else
       if ($a/contact = $v2/contact)
       then (
             replace value of node $a/contact with $v1/contact,
             replace value of node $v2/contact with $v1/contact
            )
       else (
         insert node
           <fail>
              <arch>{ $a }</arch>
              <v1>{ $v1 }</v1>
              <v2>{ $v2 }</v2>
           </fail>
         into doc("log.xml")/log
       )
,

replace value of node doc("archive.xml")/*/last-synch-time
       with current-dateTime()

Received on Friday, 17 August 2007 17:18:50 UTC