This file contains hidden or 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
(: https://libertyseeds.ca/2015/07/21/Investigating-Final-Draft-s-XML-document-format-with-Ruby/ :) | |
declare function local:update($result as map(*),$next as element()) as map(*) | |
{ | |
let $name:=name($next) | |
let $current:=$result($name) | |
let $atribs:=$next/@*[if(empty($current)) then true() else not( .=$current(name(.)))] | |
let $atribs:=map:merge(($current, $atribs!map:entry(name(.),string(.))), map{'duplicates': 'combine'}) | |
return map:put($result,$name,$atribs) | |
}; |
This file contains hidden or 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
(:~ | |
: JSON form test apb 6dec 2016 | |
:) | |
module namespace page = 'form-test'; | |
import module namespace request = "http://exquery.org/ns/request"; | |
declare | |
%rest:path("/form2") | |
%rest:GET | |
%output:method("html") |
This file contains hidden or 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 variable $src:="C:\Users\andy\git\xqlint\test\index.json"; | |
(: json-doc($src) :) | |
file:read-text($src)=>json-to-xml() |
This file contains hidden or 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 xp="http://expath.org/ns/xparse"; | |
declare variable $js:="C:\Users\andy\workspace\app-doc\src\static\doc\feats\files\files.js"; | |
let $t:="" || file:read-text($js) | |
return xp:parse($t,map{"lang":"ecmascript"}) |
This file contains hidden or 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
(: queue async run of all tests in $dir :) | |
declare function local:queue-tests($dir as xs:string,$opts as map(*)) as xs:string | |
{ | |
let $q:=``[ | |
declare variable $password external; | |
client:connect('localhost', | |
db:system()/globaloptions/port/xs:integer(.), | |
'admin', | |
$password) | |
! client:execute(.,'TEST "`{$dir}`"') |
This file contains hidden or 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
(:~ | |
: JSON test apb feb 2017 | |
:) | |
module namespace page = 'json-test'; | |
(: test data :) | |
declare variable $page:data:=<json objects="json _"> | |
<total type="number">15</total> | |
<entity>app</entity> |
This file contains hidden or 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-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl"?> | |
<?css-conversion no?> | |
<html xmlns:xf="http://www.w3.org/2002/xforms" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:ev="http://www.w3.org/2001/xml-events" | |
xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Creator test</title> | |
<link rel="stylesheet" type="text/css" href="local.css"/> | |
<xf:model> |
This file contains hidden or 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"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> | |
<Configure id="Server" class="org.eclipse.jetty.server.Server"> | |
<!-- Force all communication over secure channels. --> | |
<Set name="handler"> | |
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"> | |
<Set name="handlers"> | |
<Array type="org.eclipse.jetty.server.Handler"> | |
<Item> |
This file contains hidden or 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
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="description" content="BaseX socket test" /> | |
<meta name="author" content="andy bunce." /> | |
<title>BaseX Socket test v2</title> | |
</head | |
<body> | |
<h1>BaseX Socket test</h1> |
This file contains hidden or 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"; | |
(: | |
Various Date String Parser | |
- Parses various flavors of date strings, returns as xs:dateTime or xs:date | |
- Key functions: dates:parseDateTime() and dates:parseDate() | |
- adapted to an eXist-compatible module from date-parser.xqy from | |
http://xqzone.marklogic.com/svn/commons/trunk/dates/date-parser.xqy | |
- by Joe Wicentowski |