Tests a JSONPath indefinite query.
Test jsonpath-002.xml is expected to pass.
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:p="http://www.w3.org/ns/xproc" name="main" version="3.0" expand-text="false">
<p:import href="https://xmlcalabash.com/ext/library/jsonpath.xpl"/>
<p:output port="result"/>
<cx:jsonpath query="$..book[1].author">
<p:with-input href="../documents/find/bookstore.json"/>
</cx:jsonpath>
<p:cast-content-type content-type="application/xml"/>
</p:declare-step>
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:ns prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="fn:array">The root is not an array.</s:assert>
</s:rule>
<s:rule context="fn:array">
<s:assert test="count(*) = 1">Wrong number of results.</s:assert>
<s:assert test="fn:string = 'Evelyn Waugh'">The author is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Created test.