p:validate-with-json-schema 006 (AB)
Tests p:validate-with-json-schema: Default is XVRL on port 'report'.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result"/>
<p:validate-with-json-schema assert-valid="false">
<p:with-input href="../documents/in-valid.json"/>
<p:with-input port="schema"
href="../documents/schema.json"/>
</p:validate-with-json-schema>
<p:identity>
<p:with-input pipe="report"/>
</p:identity>
</p:declare-step>
Result
<xvrl:report xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:xvrl="http://www.xproc.org/ns/xvrl">
<xvrl:metadata>
<xvrl:timestamp>2025-06-19T17:25:47.686357696Z</xvrl:timestamp>
<xvrl:validator name="jsonSchemaValidator"
version="unknown"/>
<xvrl:creator name="XML Calabash"
version="3.0.5-SNAPSHOT"/>
<xvrl:document href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/in-valid.json"/>
<xvrl:schema href="file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/schema.json"
schematypens="https://json-schema.org/draft/2020-12/schema" language="JSON"/>
</xvrl:metadata>
<xvrl:detection severity="error" code="1028">
<xvrl:location href="https://example.com/schemas/customer#/required"
jsonpath="$"/>
<xvrl:message>$: required property 'first_name' not found</xvrl:message>
</xvrl:detection>
<xvrl:detection severity="error" code="1028">
<xvrl:location href="https://example.com/schemas/customer#/required"
jsonpath="$"/>
<xvrl:message>$: required property 'last_name' not found</xvrl:message>
</xvrl:detection>
<xvrl:digest valid="false" fatal-error-count="0"
error-count="2" warning-count="0" info-count="0"
unspecified-count="0" fatal-error-codes="" error-codes="1028"
warning-codes="" info-codes="" unspecified-codes=""
worst="error"/>
</xvrl:report>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns uri="http://www.xproc.org/ns/xvrl"
prefix="xvrl"/>
<s:pattern>
<s:rule context="/">
<s:assert test="xvrl:report">The root element is not "report".</s:assert>
<s:assert test="exists(xvrl:report/xvrl:detection)">There should be detection because JSON is invalid.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 04 Sep 2022, Achim Berndzen
- Initial commit