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
<tables> | |
<table name="Sheet 1"> | |
<thead> | |
<tr> | |
<td>A</td> | |
<td>B</td> | |
<td>C</td> | |
</tr> | |
</thead> | |
<tbody> |
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"; | |
(: | |
Sadly, the eXist 2.2 normalize-unicode() function is broken. So we call out | |
to the java one. | |
:) | |
declare namespace normalizer = "java:java.text.Normalizer"; | |
declare namespace form = "java:java.text.Normalizer$Form"; | |
declare function local:normalize($string as item()) as xs:string { |
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.1"; | |
(: Converts positive integers between base 10 and base 2-10 :) | |
declare function local:convert-base($num as xs:integer, $base as xs:integer) as xs:integer* | |
{ | |
if ($num > 0 and ($base gt 1 and $base lt 11)) | |
then local:join-nums((local:convert-base($num idiv $base, $base), $num mod $base)) | |
else () | |
}; |
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 "1.0-ml"; | |
declare namespace p = "http://www.mycompany.com"; | |
declare option xdmp:mapping "false"; | |
(:~ | |
Returns z-score for the specified confidence value | |
For confidence values not in the lookup table, |
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
#!/usr/bin/ruby -w | |
map = { 'æ' => 'AE', | |
'eɪ' => 'EY', | |
'ɑ' => 'AO', | |
'əˈ' => 'AX', | |
'i' => 'IY', | |
'ɛ' => 'EH', | |
'ɪ' => 'IH', | |
'aɪ' => 'AY', |
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
/* | |
This script uses Oxygen operation called JSOperation, see https://www.oxygenxml.com/doc/versions/18.0/ug-editorEclipse/topics/dg-default-author-operations.html. | |
For generating the personal access token to be used in this script, please select "public_repo | Access public repositories". | |
This script has to be put in the file ${framework}/commons.js. | |
In order to add the button for publishing to github, add the following code to any CSS file that is associated within the framework with the edited XML file: | |
rdf|RDF:before { | |
content: oxy_button(action, oxy_action(name, "Publish to github", operation, "ro.sync.ecss.extensions.commons.operations.JSOperation", arg-script, "function doOperation(){publishToGihub();}")) | |
} | |
*/ |
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.1"; | |
import module namespace http = "http://expath.org/ns/http-client"; | |
(: For generating the personal access token to be used in this script, please select "public_repo | Access public repositories". :) | |
let $git-token := "<your-github-token>" | |
let $user-name := "<your-github-username>" | |
let $repo-name := "<your-repo-name>" | |
let $file-path := "<file=path>" | |
let $message := "<commit-message>" | |
let $new-file-content := serialize(<a/>) |
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
module namespace epoch = "https://gist.github.com/WaxCylinderRevival/ns/xquery/date-to-epoch-time"; | |
declare function epoch:date-to-epoch-time | |
( $dateString as xs:string? ) as xs:decimal? { | |
if (empty($dateString)) | |
then () | |
else | |
if (matches($dateString, '^\d{4}-\d{2}-\d{2}$')) | |
then (xs:dateTime(xs:date($dateString)) - xs:dateTime("1970-01-01T00:00:00-00:00")) div xs:dayTimeDuration('PT1S') | |
else |
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 function local:type($item as item()?) as xs:string { | |
typeswitch ($item) | |
(: NOTE: eXist doesn't support XML Schema 1.1 types yet | |
case xs:dateTimeStamp return 'xs:dateTimeStamp' | |
:) | |
case xs:dateTime return 'xs:dateTime' | |
case xs:date return 'xs:date' | |
case xs:time return 'xs:time' | |
case xs:yearMonthDuration return 'xs:yearMonthDuration' | |
case xs:dayTimeDuration return 'xs:dayTimeDuration' |
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"; | |
(:~ | |
: Partial facet implementation for eXist-db based on the EXPath specifications (http://expath.org/spec/facet) | |
: | |
: Uses the following eXist-db specific functions: | |
: util:eval | |
: request:get-parameter | |
: request:get-parameter-names() | |
: | |
: @author Winona Salesky |