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 local:fib($n as xs:integer, $a as xs:integer, $b as xs:integer){ | |
switch ($n) | |
case 0 return $a | |
case 1 return $b | |
default return local:fib($n - 1, $b, $a + $b) | |
}; | |
declare function local:fib($n as xs:integer){ | |
local:fib($n,0,1) | |
}; |
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
xquery version "3.1"; | |
(:~ | |
: An implementation of XQuery 3.1"s fn:json-to-xml and fn:xml-to-json functions for eXist, which does not support them natively as of 4.3.0, and Xidel. | |
: | |
: @author Joe Wicentowski, Benito van der Zander | |
: @version 0.6 | |
: @see http://www.w3.org/TR/xpath-functions-31/#json | |
:) | |
module namespace jx = "http://joewiz.org/ns/xquery/json-xml"; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> | |
<teiHeader> | |
<fileDesc> | |
<titleStmt> | |
<title>TEI Minimal</title> | |
<author>James Cummings</author> | |
</titleStmt> | |
<publicationStmt> | |
<publisher>TEI Consortium</publisher> |
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
USE WideWorldImporters | |
GO | |
CREATE TABLE Sales.CustomerOrderSummary | |
( | |
ID INT NOT NULL IDENTITY, | |
CustomerID INT NOT NULL, | |
OrderSummary XML | |
); | |
INSERT INTO Sales.CustomerOrderSummary (CustomerID, | |
OrderSummary) |
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
xquery version "3.1"; | |
import module namespace imfd='http://existsolutions.com/apps/imfd' at '/db/temp/imfd.xqm'; | |
let $now := current-dateTime() | |
let $tz := timezone-from-dateTime($now) | |
let $imfd := imfd:format($now) | |
let $gmt := imfd:to-dateTime($imfd) | |
let $reversed := adjust-dateTime-to-timezone($gmt + $tz, $tz) |
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 functx = "http://www.functx.com"; | |
(: NOTE -- functx uses 1 to 7 to represent MON-SUN, whereas eXist-db's datetime module used 1 to 7 to represent SUN-SAT :) | |
declare variable $local:MON := 1; | |
declare variable $local:TUES := 2; | |
declare variable $local:WEDS := 3; | |
declare variable $local:THURS := 4; | |
declare variable $local:FRI := 5; | |
declare variable $local:SAT := 6; |
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
NAME=newBase60 | |
CONTAINER=exDev | |
PORT=8282 | |
USE_DC_OVERRIDE=yes | |
DC_OVERRIDE_NETWORK=www |
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 local:topo-sort($unsorted, $sorted ) { | |
if (empty($unsorted)) then $sorted | |
else | |
let $allnodes := $unsorted [ every $id in depends/@id satisfies $id = $sorted/@id] | |
return | |
if ($allnodes) then | |
local:topo-sort( $unsorted except $allnodes, ($sorted, $allnodes )) | |
else () | |
}; |
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
xquery version "3.0"; | |
(: the power of algebraic data types in xquery | |
This example shows how we can composite up data models | |
which 'carry' their own operations along with them. | |
:) | |
(: using John Snelson's inspirational https://github.com/jpcs/data.xq :) |
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
PROVIDER | ALGORITHM | |
-----------|------------ | |
SUN | |
MD2 | |
MD5 | |
SHA | |
SHA-224 | |
SHA-256 | |
SHA-384 | |
SHA-512 |