rsrsss/xquery/functions.xqy

21 lines
953 B
Plaintext

xquery version "3.0" encoding "utf-8";
module namespace rsrsss = "https://envs.net/~lucidiot/rsrsss/rsrsss-functions";
(: TODO: stricter type for $outlines, to require outline elements :)
declare function rsrsss:make-opml($title as xs:string, $outlines as element(outline)*) as element(opml) {
<opml version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://envs.net/~lucidiot/rsrsss/xsd/opml.xsd">
<head>
<title>{$title}</title>
<dateModified>{format-dateTime(adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration("PT0S")), "[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] GMT")}</dateModified>
<ownerName>lucidiot</ownerName>
<ownerEmail>lucidiot@envs.net</ownerEmail>
<ownerId>https://tilde.town/~lucidiot/contact.html</ownerId>
<docs>http://dev.opml.org/spec2.html</docs>
</head>
<body>
{$outlines}
</body>
</opml>
};