Skip to content

Instantly share code, notes, and snippets.

View gimsieke's full-sized avatar

Gerrit Imsieke gimsieke

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://subversion.le-tex.de/common/schema/tei-cssa/docbook-like-divs.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.tei-c.org/Vault/P5/1.7.0/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title></title>
</titleStmt>
<publicationStmt></publicationStmt>
@charset "UTF-8";
/* Inspired by Robert McNees’ original tweet, https://twitter.com/mcnees/status/661579110926282752 */
/* Works with the Stylish add-on, https://userstyles.org/help/stylish */
@-moz-document domain(twitter.com) {
.HeartAnimationContainer {
visibility: hidden
}
.HeartAnimationContainer:after, .Icon--heartBadge:before {
content:'★';
font-size: 140%;
@gimsieke
gimsieke / ndw50.xpl
Last active June 19, 2017 04:50
a birthday serenade for Norm
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ndw50="urn:ndw:birthday:50"
xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:cx="http://xmlcalabash.com/ns/extensions"
version="1.0"
exclude-inline-prefixes="c cx ndw50"
type="ndw50:serenade" name="serenade">
<p:output port="serenade-lines" sequence="true">
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://www.w3.org/ns/xproc-step"
version="1.0"
name="test-params">
<p:input port="params" kind="parameter" primary="true"/>
<?xml version="1.0" encoding="utf-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:dc="http://www.delightfulcomputing.com/ns/" version="1.0" name="textdiff-with-options" type="dc:textdiff-with-options">
<p:documentation/>
<p:option name="whitespace" select="'observe'">
<p:documentation>Alternatives: ignore, normalize. Whether inline whitespace is ignored or contracted to a single space
before comparison.</p:documentation>
</p:option>
@gimsieke
gimsieke / split.xsl
Created November 24, 2019 17:10
solution for a splitting problem raised by Rick Quatro on Mulberry XSL list on 2019-11-24
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:split="http://www.le-tex.de/XSLT/split"
exclude-result-prefixes="xs" version="3.0">
<!-- invoke it with -lib:lib/split.xsl if you checked out
https://subversion.le-tex.de/common/presentations/2019-02-09_xmlprague_xslt-upward-projection/lib/
to lib/ and if you are using Saxon 9.8+ -->
<xsl:use-package name="http://www.le-tex.de/XSLT/split"
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:err="http://www.w3.org/ns/xproc-error"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
name="urify-test"
version="3.0"
exclude-inline-prefixes="#all">
<p:input port="source" primary="true">
@gimsieke
gimsieke / input.xml
Created May 3, 2020 13:42
XSLT problem raised by Michael Müller-Hillebrand on Mulberry’s xsl-list on 2020-05-03
<?xml version="1.0" encoding="UTF-8"?>
<div>
<h2 id="E2">Item with content to be joined follows div to collect</h2>
<div>
<ol data-meta="listlevel=start">
<li>
<p>1st item</p>
</li>
</ol>
<div class="box" data-meta="collect">
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:split="http://www.le-tex.de/XSLT/split"
exclude-result-prefixes="xs split"
version="3.0">
<xsl:mode name="preprocess" on-no-match="shallow-copy"/>
<xsl:mode name="main" on-no-match="shallow-copy"/>
<xsl:mode name="postprocess" on-no-match="shallow-copy"/>
@gimsieke
gimsieke / non-tunnel-params.xq
Last active August 20, 2020 18:16
XQuery to report matching XSLT templates with non-tunnel parameters
(: This will report matching XSLT templates with non-tunnel parameters.
These are dangerous because if a template with higher priority or import
precedence intercepts a given template with such a parameter, and then
uses <xsl:next-match/> without passing the parameter, the template will
not receive the same parameter any more. This might not flag an error,
for example if the parameter is declared xs:boolean? or if there is no
as attribute at all. This can lead to unexpected behavior.
Paste the code in in the oXygen XPath/XQuery Builder or execute it
standalone with XQuery-enabled Saxon, and adapt $dir-uri according