-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 195b202 🚀
- Loading branch information
Showing
10 changed files
with
99 additions
and
8 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="pass" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>p:filter 012 (NW)</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-12-24</t:date> | ||
<t:author> | ||
<t:name>Norm Tovey-Walsh</t:name> | ||
</t:author> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Proposed test.</p> | ||
</t:description> | ||
</t:revision> | ||
</t:revision-history> | ||
</t:info> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Tests p:filter that returns a constant.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<p:output port="result"/> | ||
<p:option name="select" as="xs:string?" select="'chapter'"/> | ||
<p:variable name="eq" select="'='"/> | ||
|
||
<p:identity> | ||
<p:with-input> | ||
<book> | ||
<chapter>Hello, world.</chapter> | ||
<appendix>Goodbye, world.</appendix> | ||
</book> | ||
</p:with-input> | ||
</p:identity> | ||
|
||
<p:filter select="count(/book/*[local-name(.) {$eq} '{$select}'])"/> | ||
|
||
<p:cast-content-type content-type="application/xml"/> | ||
</p:declare-step> | ||
</t:pipeline> | ||
|
||
<t:schematron> | ||
<s:schema queryBinding="xslt2" | ||
xmlns:s="http://purl.oclc.org/dsdl/schematron" | ||
xmlns="http://www.w3.org/1999/xhtml"> | ||
<s:ns prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/> | ||
<s:pattern> | ||
<s:rule context="/"> | ||
<s:assert test="fn:number">The result root is not a number.</s:assert> | ||
<s:assert test="string(.) = '1'">The result is not 1.</s:assert> | ||
</s:rule> | ||
</s:pattern> | ||
</s:schema> | ||
</t:schematron> | ||
</t:test> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE HTML><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><title>p:filter 012 (NW)</title><link href="../css/prism.css" rel="stylesheet" type="text/css"><link href="../css/db-prism.css" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/base.css"><link rel="stylesheet" type="text/css" href="../css/xproc.css"><link rel="stylesheet" type="text/css" href="../css/base.css"><link href="../css/all.css" rel="stylesheet" type="text/css"><link href="../css/testsuite.css" rel="stylesheet" type="text/css"><script type="text/javascript" src="../js/dbmodnizr.js"></script></head><body><nav><a href="nw-filter-011.html"><i class="fas fa-chevron-circle-left"></i></a> <a href="nw-http-request-117.html"><i class="fas fa-chevron-circle-right"></i></a> <a href="../"><i class="fa fa-chevron-circle-up"></i></a></nav><h1>p:filter 012 (NW)</h1><div class="description"> | ||
<p>Tests p:filter that returns a constant.</p> | ||
</div><p class="expected">Test <a class="testuri" href="../test-suite/tests/nw-filter-012.xml">nw-filter-012.xml</a> is expected to pass.</p><div class="pipeline"><h2>The pipeline</h2><pre class="programlisting line-numbers language-markup" data-language="Markup"><code> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:declare-step</span> <span class="attr nsattr"><span class="aname">xmlns:p</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">http://www.w3.org/ns/xproc</span><span class="aq">"</span></span> <span class="attr nsattr"><span class="aname">xmlns:xs</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">http://www.w3.org/2001/XMLSchema</span><span class="aq">"</span></span> <span class="attr"><span class="aname">version</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">3.0</span><span class="aq">"</span></span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:output</span> <span class="attr"><span class="aname">port</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">result</span><span class="aq">"</span></span><span class="eto">/></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:option</span> <span class="attr"><span class="aname">name</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">select</span><span class="aq">"</span></span> <span class="attr"><span class="aname">as</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">xs:string?</span><span class="aq">"</span></span> <span class="attr"><span class="aname">select</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">'chapter'</span><span class="aq">"</span></span><span class="eto">/></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:variable</span> <span class="attr"><span class="aname">name</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">eq</span><span class="aq">"</span></span> <span class="attr"><span class="aname">select</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">'='</span><span class="aq">"</span></span><span class="eto">/></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:identity</span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:with-input</span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">book</span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">chapter</span><span class="eto">></span></span><span class="text">Hello, world.</span><span class="etag"><span class="eto"></</span><span class="gi endgi">chapter</span><span class="etc">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">appendix</span><span class="eto">></span></span><span class="text">Goodbye, world.</span><span class="etag"><span class="eto"></</span><span class="gi endgi">appendix</span><span class="etc">></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">book</span><span class="etc">></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">p:with-input</span><span class="etc">></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">p:identity</span><span class="etc">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:filter</span> <span class="attr"><span class="aname">select</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">count(/book/*[local-name(.) {$eq} '{$select}'])</span><span class="aq">"</span></span><span class="eto">/></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">p:cast-content-type</span> <span class="attr"><span class="aname">content-type</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">application/xml</span><span class="aq">"</span></span><span class="eto">/></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">p:declare-step</span><span class="etc">></span></span> | ||
</code></pre></div><div class="schematron"><h2>Schematron validation</h2><pre class="programlisting line-numbers language-markup" data-language="Markup"><code> | ||
<span class="stag"><span class="sto"><</span><span class="gi">s:schema</span> <span class="attr nsattr"><span class="aname">xmlns</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">http://www.w3.org/1999/xhtml</span><span class="aq">"</span></span> <span class="attr nsattr"><span class="aname">xmlns:s</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">http://purl.oclc.org/dsdl/schematron</span><span class="aq">"</span></span> <span class="attr"><span class="aname">queryBinding</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">xslt2</span><span class="aq">"</span></span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">s:ns</span> <span class="attr"><span class="aname">prefix</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">fn</span><span class="aq">"</span></span> <span class="attr"><span class="aname">uri</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">http://www.w3.org/2005/xpath-functions</span><span class="aq">"</span></span><span class="eto">/></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">s:pattern</span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">s:rule</span> <span class="attr"><span class="aname">context</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">/</span><span class="aq">"</span></span><span class="eto">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">s:assert</span> <span class="attr"><span class="aname">test</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">fn:number</span><span class="aq">"</span></span><span class="eto">></span></span><span class="text">The result root is not a number.</span><span class="etag"><span class="eto"></</span><span class="gi endgi">s:assert</span><span class="etc">></span></span> | ||
<span class="stag"><span class="sto"><</span><span class="gi">s:assert</span> <span class="attr"><span class="aname">test</span><span class="aeq">=</span><span class="aq">"</span><span class="avalue">string(.) = '1'</span><span class="aq">"</span></span><span class="eto">></span></span><span class="text">The result is not 1.</span><span class="etag"><span class="eto"></</span><span class="gi endgi">s:assert</span><span class="etc">></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">s:rule</span><span class="etc">></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">s:pattern</span><span class="etc">></span></span> | ||
<span class="etag"><span class="eto"></</span><span class="gi endgi">s:schema</span><span class="etc">></span></span> | ||
</code></pre></div><dl class="revision-history"><h2>Revision history</h2> | ||
<dt>24 Dec 2024, | ||
<span class="name">Norm Tovey-Walsh</span> | ||
</dt><dd><div class="description"> | ||
<p>Proposed test.</p> | ||
</div></dd> | ||
</dl><script src="../js/prism.js"></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