Test p-inline-003.xml is expected to pass.
<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0">
<p:output port="result" sequence="true"/>
<p:identity name="inline">
<p:with-input port="source">
<p:inline encoding="base64" content-type="image/png">iVBORw0KGgoAAAANSUhEUgAAAIAAAAAdCAYAAABixmRWAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAA
CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QoICxwdF+yMrAAADXpJREFUaN7tW2lsFOUb/83u
0u2W7W7psQW6bekWKAiUS8EiCgasqEEh0RBMjEGjwXgn6he/6QdRMRgUvGI8IzGeoKBcBkWwgD04
ytkWtpRS2Ha37Z7t7s78P/zyOjM724pGCfztk0zozrzH8z7P7zlnkE6dUpRly4C6OkCS8AcpCuB2
Axs3AjNmQEfJJPDEE8D69fo5AGCxAGvWAI8+yt/NzcBvv3G9dGQyATfcAIwZo7+fSAC7dgHt7cY9
BH8uF7BgATBsGO/19gLbtgHRqHH89OnA5MkYohQyjR0LrFwJZGZSqOICgLY24OOPqQwtHT4MfP89
/9bOURQq8+67L52BZBIIBIz3o1EgGBx87kCgSr0/0LghAkwAsGwZsHhx+gEbNgB796q/43Hg/feB
1lbj2Nxc4JlngMLCv8aE308gaKmnhyBIZ/1D9M+RCQAcDuDZZ4GSEuOAixfp6iMR/q6rA776Kv1i
994LVFdf+uaSxBDQ3Q34fPpngYARFP8V8vmAs2cvz14W8ce11zJuP/+80eVv2QJs3QrceSet//x5
40KTJwOPPabG44FIWHQ0ypjd3Q00NABffgnMmQOYzUBeHhAKcWxGxn/LhZ87B+zfTznm5QFZWf/u
fn8AQJKABx4AduwAtm/XDwoGgbfeoiI2bjQukpkJPPkkUFFxaQc8fpwWHgwC9fVU9n33UfmnTwNv
vAF0dAAzZwJLlwI5OYD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rKCIIlS9SOnqDcXHYDL1ygskTDadEixmezmXwWFHANr5fz7Ha2
koXXE96qr48g9njoKfr7GQqsVvIsSXTvBw8SKD09vD99uj6hlCS67Lw8KtLtJi99fVxz3Dg9AEQp
6XSSb49H38BSFCp5zBiew2qlR5RlnkEXRmtqFCUeN34QarEw89WWEVpSFFqvz2ecC9C9OxyMO9qY
KARos5HJzEz+G43qv0e0Wml5mzdz/MyZxj6DxcLw4ffTciIRKsrtVrteWpIk7tPQQKsRYzMyVM9i
t6vW2t+vfpSSmqh6vWzdJhLkoaiIl7AuRVHdbzJJwbvdBHpqmRcO0wvk5alxG+C8aJQeOPV9i99P
kGgTw3icVn/2LK2+vJzzkkngl18I+vnz9d5HUpQr+3sbgfYrjRSFAhfWlu6F2KWM+acoHqen6eig
h9FWV5EI2+mJBD2z1qgtf2+7y0dXovIFX+n6An91zD9BiQSTRp+PLd7UBlcwSBC4XPpKAkjzPcAQ
XV0k2r5nztDy03U3u7oYBoqKjGF0CABXOZ0/TwA4ncaWMEDLb21l/pH6n2+AqyAEDNHg5PWyWujp
YfInXgyJD09OnyY4Kiv1CaagIQBc5ZSdzTwjHGa5LaorSaLCS0t5DfS5/hVfBQzR4BSPswPb2UlP
YDKxbMzLozdIZ/Va+h+pXB4HigH3owAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJ
TVDvZCVuAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE3LTEwLTA4VDExOjI4OjQwLTA1OjAwZzsZlQAA
ACV0RVh0ZGF0ZTptb2RpZnkAMjAxNy0xMC0wOFQxMToyODoyOS0wNTowMEWR7X0AAAAASUVORK5C
YII=
</p:inline>
</p:with-input>
</p:identity>
<p:cast-content-type content-type="application/xml" name="properties">
<p:with-input port="source" select="p:document-properties(.)"/>
</p:cast-content-type>
<p:cast-content-type name="cast" content-type="application/xml">
<p:with-input port="source" pipe="@inline"/>
</p:cast-content-type>
<p:wrap-sequence wrapper="c:result">
<p:with-input port="source" pipe="@properties @cast"/>
</p:wrap-sequence>
</p:declare-step>
<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="j" uri="http://www.w3.org/2005/xpath-functions"/>
<s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
<s:pattern>
<s:rule context="/*">
<s:assert test="self::c:result">The pipeline root is not c:result</s:assert>
<s:assert test="j:map">The result does not include j:map</s:assert>
<s:assert test="c:data">
The result does not include c:data
</s:assert>
</s:rule>
<s:rule context="/c:result/j:map">
<s:assert test="empty(*[@key='content-length']) or (*[@key='content-length'] = 3764)">
The wrong content-length is reported
</s:assert>
<s:assert test="j:string[@key ='content-type']/text() = 'image/png'">
The content type of the result is not image/png
</s:assert>
</s:rule>
<s:rule context="/c:result/c:data">
<s:assert test="@encoding='base64'">
The encoding is not base64
</s:assert>
<s:assert test="starts-with(string(.), 'iVBORw0KGgoAAAA') and ends-with(string(.), 'YII=')">
The encoded content appears to be wrong
</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Added attribute 'queryBinding' to schematron's schema.
Changed test from p:document-properties-document() to p:document-properties().
Fixed result document
(
c:document-properties
, not
p:document-properties
)
Fixing broken test (namespace removed)
=Adapted tests to PR #422
Change test with document-properties to map{xs:QName, item()}
Some new tests.
Reversed @pipe-substructure. (->Prague 2018)
added new tests
New p:inline tests