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
(: | |
explore if the proposed XQuery 4 function fn:type can be used | |
to inspect sequences of items to find the most specific shared | |
type among them | |
:) | |
declare namespace ist="//line-o.de/ns/inspect-sequence-types"; | |
declare function ist:find-shared-type ($acc as xs:string*, $next as xs:string*) as xs:string* { | |
let $count-a := count($acc) | |
let $count-n := count($next) |
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"; | |
declare namespace enc="//-o/ns/xquery/encoding"; | |
import module namespace bin="http://expath.org/ns/binary"; | |
declare function enc:fix ($string as xs:string) as xs:string { | |
analyze-string($string, "(\\u00([0-9a-z]{2})\\u00([0-9a-z]{2}))")/element() | |
=> for-each(enc:process#1) | |
=> string-join("") |
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"; | |
module namespace emt="//external-module-test"; | |
declare function emt:transform($node as node()) as node()+ { | |
typeswitch ($node) | |
case document-node() return document { emt:transform($node/element()) } | |
case attribute(xml:id) return ( | |
attribute old-id { $node/string() }, | |
attribute xml:id { "s" || $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
import module namespace array="http://www.w3.org/2005/xpath-functions/array"; | |
import module namespace map="http://www.w3.org/2005/xpath-functions/map"; | |
declare namespace _="//line-o.de/ns/underline"; | |
declare function _:nth-item ($sequence as item()*, $pos as xs:integer) as item()* { | |
$sequence[$pos] | |
}; | |
declare function _:reduce-sequences ( |
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 prob = "//line-o.de/ns/prob"; | |
declare namespace map = "http://www.w3.org/2005/xpath-functions/map"; | |
declare namespace array = "http://www.w3.org/2005/xpath-functions/array"; | |
(: select by p from prepared sequence of options :) | |
declare | |
function prob:select-by-p($options as array(*)+, $p as xs:double) as item()* { | |
fold-left($options, (), | |
prob:select(?, ?, $p) |
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
<html> | |
<body> | |
<script type="text/javascript"><![CDATA[ console.log(true && 1 < 2) ]]></script> | |
</body> | |
</html> |
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"; | |
module namespace orcid="orcid/validate"; | |
declare variable $orcid:R := 2; | |
declare variable $orcid:M := 11; | |
declare variable $orcid:format := '^(\d{4}-\d{4}-\d{4}-\d{3}|\d{15})[0-9X]$'; | |
declare variable $orcid:is-valid-format := matches(?, $orcid:format); | |
declare variable $orcid:expected-sum := map{ | |
'1':1, '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, 'X':10 |
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
0600 (.rw-------) -> 0700 (.rwx------) | |
0755 (.rwxr-xr-x) -> 0755 (.rwxr-xr-x) | |
0660 (.rw-rw----) -> 0770 (.rwxrwx---) | |
0664 (.rw-rw-r--) -> 0775 (.rwxrwxr-x) | |
0666 (.rw-rw-rw-) -> 0777 (.rwxrwxrwx) | |
0622 (.rw--w--w-) -> 0733 (.rwx-wx-wx) | |
0777 (.rwxrwxrwx) -> 0777 (.rwxrwxrwx) |
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"; | |
declare function local:safe-effective-boolean-value-if ( | |
$result as item()* | |
) as xs:boolean { | |
try { | |
if ($result) | |
then true() | |
else false() | |
} catch err:FORG0006 { |
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
<main class="news-list__latest"> | |
<ul> | |
<li data-template="templates:each" data-template-from="articles" data-template-to="article"> | |
<a data-template="pr:article-link"/> | |
</li> | |
</ul> | |
</main> |
NewerOlder