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
# Go to https://bottlecaps.de/rex/ and use this command line on nested-parentheses.ebnf: -xslt -main -tree -ll 3 -backtrack | |
# Assumption: A Saxon front-end script called 'saxon' is on the path | |
saxon -o:out.xml -it:main -xsl:nested-parentheses.xslt input='{(((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))}' '!indent=yes' | |
# Looking at the main template of the generated XSLT, you need to surround the input string with curly braces; otherweise it will be interpreted as a file name |
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
<body> | |
<sec> | |
<title><target id="p-3"/>Title<fn> | |
<p>Footnote, <target id="fnp-4"/>continued</p> | |
</fn></title> | |
<p>Text<fn> | |
<p>Second footnote</p> | |
</fn> | |
<target id="p-4"/>flow<fn> | |
<p>Next footnote</p> |
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 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 |
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" 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"/> |
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" 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"> |
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" 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"> |
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" 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" |
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" 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> |
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" 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"/> | |
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" 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"> |
NewerOlder