Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test-suite/pipelines/import-034-lib1.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<p:library version="3.1" xmlns:p="http://www.w3.org/ns/xproc">
<p:option name="static-option" static="true" select="42" />
</p:library>
14 changes: 14 additions & 0 deletions test-suite/pipelines/import-034-lib2.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<p:library version="3.1" xmlns:p="http://www.w3.org/ns/xproc"
xmlns:test="http://test">
<p:import href="import-034-lib3.xpl" />
<p:import href="import-034-lib1.xpl" />

<p:declare-step type="test:step">
<p:output port="result" />

<p:identity>
<p:with-input><dummy /></p:with-input>
</p:identity>
</p:declare-step>
</p:library>
13 changes: 13 additions & 0 deletions test-suite/pipelines/import-034-lib3.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<p:library version="3.1" xmlns:p="http://www.w3.org/ns/xproc"
xmlns:test="http://test">
<p:import href="import-034-lib1.xpl" />

<p:declare-step type="test:step1">
<p:output port="result" />

<p:identity>
<p:with-input><dummy /></p:with-input>
</p:identity>
</p:declare-step>
</p:library>
46 changes: 46 additions & 0 deletions test-suite/tests/ab-import-034.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0" expected="pass">
<t:info>
<t:title>p:import-034 (AB)</t:title>
<t:revision-history>
<t:revision>
<t:date>2025-08-07</t:date>
<t:author>
<t:name>Achim Berndzen</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial test</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests p:import: Tests re-entrant import does not raise a static error for shadowing static options (XS0088).</p>
</t:description>


<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:test="http://test" name="pipeline" version="3.0">
<p:import href="../pipelines/import-034-lib1.xpl" />
<p:import href="../pipelines/import-034-lib2.xpl" />

<p:output port="result" />

<p:identity>
<p:with-input><result>No static error raised.</result></p:with-input>
</p:identity>
</p:declare-step>
</t:pipeline>

<t:schematron>
<s:schema queryBinding="xslt2"
xmlns:s="http://purl.oclc.org/dsdl/schematron">
<s:pattern>
<s:rule context="/">
<s:assert test="result">The root element is not 'result'.</s:assert>
<s:assert test="result/text()='No static error raised.'">The text child of root element is not correct.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
</t:schematron>
</t:test>
44 changes: 44 additions & 0 deletions test-suite/tests/ab-message-attribute-001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0008">
<t:info>
<t:title>Message attribute 001 (AB)</t:title>
<t:revision-history>
<t:revision>
<t:date>2025-08-25</t:date>
<t:author>
<t:name>Achim Berndzen</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Added new tests for message attribute.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests @message on p:when is not allowed.</p>
</t:description>
<t:pipeline>
<p:declare-step version="3.0" xmlns:p="http://www.w3.org/ns/xproc">
<p:output port="result" />

<p:identity name="source">
<p:with-input><test /></p:with-input>
</p:identity>

<p:choose>
<p:when test="true()" message="Not allowed here!">
<p:identity>
<p:with-input><true /></p:with-input>
</p:identity>
</p:when>
<p:otherwise>
<p:identity>
<p:with-input><false /></p:with-input>
</p:identity>
</p:otherwise>
</p:choose>

</p:declare-step>
</t:pipeline>
</t:test>
44 changes: 44 additions & 0 deletions test-suite/tests/ab-message-attribute-002.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0008">
<t:info>
<t:title>Message attribute 002 (AB)</t:title>
<t:revision-history>
<t:revision>
<t:date>2025-08-25</t:date>
<t:author>
<t:name>Achim Berndzen</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Added new tests for message attribute.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests @message on p:otherwise is not allowed.</p>
</t:description>
<t:pipeline>
<p:declare-step version="3.0" xmlns:p="http://www.w3.org/ns/xproc">
<p:output port="result" />

<p:identity name="source">
<p:with-input><test /></p:with-input>
</p:identity>

<p:choose>
<p:when test="true()">
<p:identity>
<p:with-input><true /></p:with-input>
</p:identity>
</p:when>
<p:otherwise message="Not allowed here!">
<p:identity>
<p:with-input><false /></p:with-input>
</p:identity>
</p:otherwise>
</p:choose>

</p:declare-step>
</t:pipeline>
</t:test>
38 changes: 38 additions & 0 deletions test-suite/tests/ab-message-attribute-003.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0008">
<t:info>
<t:title>Message attribute 003 (AB)</t:title>
<t:revision-history>
<t:revision>
<t:date>2025-08-25</t:date>
<t:author>
<t:name>Achim Berndzen</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Added new tests for message attribute.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests @message on p:catch is not allowed.</p>
</t:description>
<t:pipeline>
<p:declare-step version="3.0" xmlns:p="http://www.w3.org/ns/xproc">
<p:output port="result" />

<p:identity>
<p:with-input><test/></p:with-input>
</p:identity>

<p:try>
<p:error code="Q{{}}error"/>
<p:catch message="Message not allowed here!">
<p:identity/>
</p:catch>
</p:try>

</p:declare-step>
</t:pipeline>
</t:test>
42 changes: 42 additions & 0 deletions test-suite/tests/ab-message-attribute-004.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0008">
<t:info>
<t:title>Message attribute 004 (AB)</t:title>
<t:revision-history>
<t:revision>
<t:date>2025-08-25</t:date>
<t:author>
<t:name>Achim Berndzen</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Added new tests for message attribute.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests @message on p:finally is not allowed.</p>
</t:description>
<t:pipeline>
<p:declare-step version="3.0" xmlns:p="http://www.w3.org/ns/xproc">
<p:output port="result" />

<p:identity>
<p:with-input><test/></p:with-input>
</p:identity>

<p:try>
<p:error code="Q{{}}error"/>
<p:catch message="catch">
<p:identity/>
</p:catch>
<p:finally message="Not allowed here!">
<p:output port="result" primary="false" sequence="true"/>
<p:identity />
</p:finally>
</p:try>

</p:declare-step>
</t:pipeline>
</t:test>