XQuery in the Cloud
Cutting Edge Web Applications with
XQuery and Sausalito
William Candillon {william.candillon@28msec.com}
PHP & XQuery
A Complementary Couple?
Some Misconceptions


 • XQuery:
   - is not a scripting language
   - has no application serveur
   - has no open source development tools
   - has no utility functions for the Web
Some Misconceptions


 • XQuery:
   - is not a scripting language
   - has no application serveur
   - has no open source development tools
   - has no utility functions for the Web
Some Misconceptions




            XQuery is not a
            scripting language!
XQuery Scripting (WC3)


 •   XQuery Scripting Extension 1.0 and XQuery Update Facility 1.0

 •   Imperative programming
     declare function sequential local:hello-world() {
       declare $hello := "Hello";
       declare $world := "World";
       exit with concat($hello, " ", $world);
     }


 •   Side-effects
     replace value of $client/@id with "foo";


 •   Loops
     while(true()) { server:handle() }
XQuery Scripting (Zorba)


 •   Try/Catch
     try { 3 + "2" } catch * { "Caught an error" }


 •   Eval
     let $x := "21" return using $x
     eval { concat($x, "+ xs:double ($x)") }


 •   Command-line Input/Output
     let $name := util:read-line()
     return util:print("Hello", $name)
Some Misconceptions




            XQuery has no
            Application Server
Sausalito

 •   XQuery Application Server based on Zorba XQuery Processor
     and Amazom Cloud Computing Stack




 •   Success Story: http://doodlendar.my28msec.com
Some Misconceptions




            XQuery has no
            Open Source Tools
XQuery Development Tools

http://www.eclipse.org/webtools/incubator/
Some Misconceptions




         XQuery has no utility
         functions for the Web
Utility Functions


  More than 28 modules in Sausalito library
   - HTTP           - AtomPub      - Collections
   - REST           - Captchas     - Strings
   - Security       - AtomPub      - Maths
   - Sessions       - Emails       - Media
   - OAuth          - Serializer   - Etc...
AtomPub Module


 •   Compliant with RFC 5023

 •   AtomPub Server for the Cloud
     declare function atom:entries(){
        atompub:handle($serviceDocument)
     };


 •   Atom Store
     atomstore:new-feed("/atom/entries",
       <a:feed><a:title>Demo Blog</a:title></a:feed>);


 •   Model helpers
     declare $e := f:new-entry(util:uuid(), "XQuery Meetup");
     f:set-content($e, f:new-content("Go for a drink with XML/
     XQuery lovers!"))
Thank You!




     Questions ?
     contact@28msec.com



     More info
     http://sausalito.28msec.com




Because green is the new blue...
Take it for a ride

  http://try.zorba-xquery.com

XQuery in the Cloud

  • 1.
    XQuery in theCloud Cutting Edge Web Applications with XQuery and Sausalito William Candillon {william.candillon@28msec.com}
  • 2.
  • 3.
  • 4.
    Some Misconceptions •XQuery: - is not a scripting language - has no application serveur - has no open source development tools - has no utility functions for the Web
  • 5.
    Some Misconceptions •XQuery: - is not a scripting language - has no application serveur - has no open source development tools - has no utility functions for the Web
  • 6.
    Some Misconceptions XQuery is not a scripting language!
  • 7.
    XQuery Scripting (WC3) • XQuery Scripting Extension 1.0 and XQuery Update Facility 1.0 • Imperative programming declare function sequential local:hello-world() { declare $hello := "Hello"; declare $world := "World"; exit with concat($hello, " ", $world); } • Side-effects replace value of $client/@id with "foo"; • Loops while(true()) { server:handle() }
  • 8.
    XQuery Scripting (Zorba) • Try/Catch try { 3 + "2" } catch * { "Caught an error" } • Eval let $x := "21" return using $x eval { concat($x, "+ xs:double ($x)") } • Command-line Input/Output let $name := util:read-line() return util:print("Hello", $name)
  • 9.
    Some Misconceptions XQuery has no Application Server
  • 10.
    Sausalito • XQuery Application Server based on Zorba XQuery Processor and Amazom Cloud Computing Stack • Success Story: http://doodlendar.my28msec.com
  • 11.
    Some Misconceptions XQuery has no Open Source Tools
  • 12.
  • 13.
    Some Misconceptions XQuery has no utility functions for the Web
  • 14.
    Utility Functions More than 28 modules in Sausalito library - HTTP - AtomPub - Collections - REST - Captchas - Strings - Security - AtomPub - Maths - Sessions - Emails - Media - OAuth - Serializer - Etc...
  • 15.
    AtomPub Module • Compliant with RFC 5023 • AtomPub Server for the Cloud declare function atom:entries(){ atompub:handle($serviceDocument) }; • Atom Store atomstore:new-feed("/atom/entries", <a:feed><a:title>Demo Blog</a:title></a:feed>); • Model helpers declare $e := f:new-entry(util:uuid(), "XQuery Meetup"); f:set-content($e, f:new-content("Go for a drink with XML/ XQuery lovers!"))
  • 16.
    Thank You! Questions ? contact@28msec.com More info http://sausalito.28msec.com Because green is the new blue...
  • 17.
    Take it fora ride http://try.zorba-xquery.com