validate-json-schema-001
Tests that metadata is correct for JSON schema validation.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result" pipe="report@validation"/>
<p:validate-with-json-schema name="validation">
<p:with-input href="../../../3.0-test-suite/test-suite/documents/valid.json"/>
<p:with-input port="schema"
href="../../../3.0-test-suite/test-suite/documents/schema.json"/>
</p:validate-with-json-schema>
<p:sink/>
</p:declare-step>
Schematron checks
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
<s:ns prefix="xvrl"
uri="http://www.xproc.org/ns/xvrl"/>
<s:pattern>
<s:rule context="/">
<s:assert test="xvrl:report">The result isn’t a report.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/xvrl:report">
<s:assert test="xvrl:metadata">The report doesn’t include metadata.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/xvrl:report/xvrl:metadata">
<s:assert test="xvrl:timestamp">The metadata isn’t timestamped.</s:assert>
<s:assert test="xvrl:validator">The metadata doesn’t include the validator.</s:assert>
<s:assert test="xvrl:validator[@name='jsonSchemaValidator']">The validator is unexpected.</s:assert>
<s:assert test="xvrl:creator">The metadata doesn’t include the creator.</s:assert>
<s:assert test="xvrl:creator[@name='XML Calabash']">The creator is unexpected.</s:assert>
<s:assert test="xvrl:schema">The metadata doesn’t include the schema.</s:assert>
<s:assert test="xvrl:schema[@schematypens='https://json-schema.org/draft/2020-12/schema']">The schema type is unexpected.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 13 Jan 2025, Norm Tovey-Walsh
- Created test.