This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: The "news-data" Library Module :) | |
module namespace news-data = "http://www.news.org/lib/data"; | |
import schema namespace news-schemas = "http://www.news.org/schemas/schemas"; | |
declare collection news-data:employees as schema-element(news-schemas:employee)*; | |
declare collection news-data:articles as node()*; | |
declare variable $news-data:employees := xs:QName("news-data:employees"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $x as xs:string := "Value of X" | |
return $x (: returns: "Value of X" :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $x := "Value of X" | |
return trace($x,"I'm tracing $x: ") (: still returns: "Value of X" :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import module namespace guestbook = "http://www.28msec.com/templates/guestbook/guestbook"; | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $entry:= <entry author="bulkloader" | |
date="2010-01-15" | |
time="13:25:00.000">bulkload entry</entry> | |
return | |
xqddf:insert-nodes(xs:QName("guestbook:entries"), $entry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import module namespace guestbook = "http://www.28msec.com/templates/guestbook/guestbook"; | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; | |
let $entries := fn:doc("xml_files/old_entries.xml")//entry | |
return | |
xqddf:insert-nodes(xs:QName("guestbook:entries"), $entries) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<entries> | |
<entry author="bulkloader" date="2010-01-15" time="13:25:00.000">first entry</entry> | |
<entry author="bulkloader" date="2010-01-16" time="17:19:00.000">second entry</entry> | |
<entry author="bulkloader" date="2010-01-19" time="14:42:00.000">third entry</entry> | |
</entries> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import module namespace guestbook = "http://www.28msec.com/templates/guestbook/guestbook"; | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; | |
if (fn:exists(xqddf:collection(xs:QName("guestbook:entries")))) | |
then | |
() | |
else | |
let $entries := fn:doc("xml_files/old_entries.xml")//entry | |
return | |
xqddf:insert-nodes(xs:QName("guestbook:entries"), $entries) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import module namespace guestbook = "http://www.28msec.com/templates/guestbook/guestbook"; | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; | |
xqddf:delete-nodes(xs:QName("guestbook:entries"), xqddf:collection(xs:QName("guestbook:entries"))), | |
let $entries := fn:doc("xml_files/old_entries.xml")//entry | |
return | |
xqddf:insert-nodes(xs:QName("guestbook:entries"), $entries) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module namespace ex = "http://www.28msec.com/example"; | |
import module namespace cookie = "http://www.28msec.com/modules/http/cookie"; | |
declare sequential function ex:howto-set-a-cookie() { | |
cookie:set-cookie( | |
<cookie:cookie | |
name="examplecookie" | |
expires="2020-10-24T18:00:00" | |
path="/" |
OlderNewer