p:validate-with-json-schema — The standard p:validate-with-json-schema step.
The p:validate-with-json-schema
step applies
a JSON schema validation (as defined in JSON schema and
other publications) to the source input.
Input port | Primary | Sequence | Content types |
---|
source | ✔ | | json |
schema | | | json |
Output port | Primary | Sequence | Content types |
---|
result | ✔ | | json |
report | | ✔ | xml json |
Option name | Type | Default value |
---|
assert-valid | xs:boolean | true() |
default-version | xs:string? | () |
parameters | map(xs:QName,item()*)? | () |
report-format | xs:string | 'xvrl' |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:input port="source" primary="true" content-types="json"/>
| <p:input port="schema" sequence="false" content-types="json"/>
| <p:output port="result" primary="true" content-types="json"/>
5 | <p:output port="report" sequence="true" content-types="xml json"/>
| <p:option name="assert-valid" select="true()" as="xs:boolean"/>
| <p:option name="default-version" as="xs:string?"/>
| <p:option name="parameters" as="map(xs:QName,item()*)?"/>
| <p:option name="report-format" select="'xvrl'" as="xs:string"/>
10 |</p:declare-step>
Errors
Code | Description |
---|
err:XC0163 | It is a dynamic error (err:XC0163 )
if the selected version is not supported. |
err:XC0164 | It is a dynamic error (err:XC0164 )
if the document supplied on schema port is not a valid JSON schema
document in the selected version. |
err:XC0165 | It is a dynamic error (err:XC0165 )
if the assert-valid option on p:validate-with-json-schema
is true
and the input document is not valid. |
Implementation defined features
- If
the schema does not specify a version and option
default-version
is empty, the version used is implementation-defined.