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-delete-a-cookie() { | |
cookie:set-cookie( | |
<cookie:cookie | |
name="examplecookie" | |
(: sets expires date to 1 second before now :) | |
expires="{fn:current-dateTime()-xs:dayTimeDuration('PT1S')}" |
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
http:set-status(400); | |
(: with the content-type "application/json" the json xml is automatically serialized to JSON :) | |
http:set-content-type("application/json"); | |
(: this is the xml representation of JSON which makes it easy to generate it, and work with it within sausalito :) | |
<json type="object"> | |
<pair name="status" type="number">400</pair> | |
<pair name="statusmessage" type="string">Bad Request</pair> | |
<pair name="message" type="string">Please, enter a search term</pair> |
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
module namespace script-1 = "http://www.news.org/lib/script1"; | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; | |
import schema namespace news-schemas = "http://www.news.org/schemas/schemas"; | |
import module namespace news-data = "http://www.news.org/lib/data"; | |
declare sequential function script-1:insert() { | |
xqddf:insert-nodes($news-data:employees, (<employee id="100">....</employee>, ..., <employee id="500">...</employee>)); |
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-schema:employee)*; | |
declare collection news-data:articles as node()*; |
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 "probe-1" example :) | |
xqddf:probe-index-point($news-data:CityEmp, "Paris") |
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 "probe-2" example :) | |
xqddf:probe-index-range($news-data:ArtCountEmp, 100, (), true, false, true, false) |
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 "no-probe-2" query :) | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; | |
import module namespace news-data = "http://www.news.org/data" at "news_data.xqlib"; | |
for $emp in xqddf:collection($news-data:employees)/employee[./position/@kind eq "journalist"] | |
where 100 <= count(for $art in xqddf:collection(xs:QName("news-data:articles"))//article | |
where $art/empid eq $emp/id | |
return $art) | |
return $emp |
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 "no-probe-2" query :) | |
import module namespace xqddf = "http://www.zorba-xquery.com/modules/xqddf"; | |
import module namespace news-data = "http://www.news.org/data" at "news_data.xqlib"; | |
for $emp in xqddf:collection($news-data:employees)/employee[./position/@kind eq "journalist"] | |
where 100 <= count(for $art in xqddf:collection(xs:QName("news-data:articles"))//article | |
where $art/empid eq $emp/id | |
return $art) | |
return $emp |
This file has been truncated, but you can view the full file.
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
Using worker: worker-linux-11-2.bb.travis-ci.org:travis-linux-9 | |
$ export CXX=g++ | |
$ export CC=gcc | |
travis_fold:start:git.1 | |
$ git clone --depth=50 --branch=w3c_tests git://github.com/28msec/zorba.git 28msec/zorba | |
Cloning into '28msec/zorba'... | |
remote: Counting objects: 45396, done.[K | |
remote: Compressing objects: 0% (1/14615) [K | |
remote: Compressing objects: 1% (147/14615) [K |
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 function conversion:facts-to-odata($facts as object*) as node()* | |
{ | |
for $f at $y in $facts | |
return | |
<entry xmlns='http://www.w3.org/2005/Atom' | |
xmlns:m='http://schemas.microsoft.com/ado/2007/08/dataservices/metadata' | |
xmlns:d='http://schemas.microsoft.com/ado/2007/08/dataservices' | |
xml:base='http://www.xbrlsite.com/2014/Demos/OData/SECXBRLinfo.svc/'> | |
<id>{"http://secxbrl.info/odata/" || current-date() || "/" || $y}</id> | |
<category term='SEC.FundamentalAccountingConcepts' scheme='http://schemas.microsoft.com/ado/2007/08/dataservices/scheme'/> |