Name

p:validate-with-json-schema — The standard p:validate-with-json-schema step.

Synopsis

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 portPrimarySequenceContent types
source✔  json 
schema  json 
Output portPrimarySequenceContent types
result✔  json 
report ✔ xml json 
Option nameTypeDefault value
assert-validxs:booleantrue()
default-versionxs:string?()
parametersmap(xs:QName,item()*)?()
report-formatxs: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
CodeDescription
err:XC0163It is a dynamic error (err:XC0163) if the selected version is not supported.
err:XC0164It 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:XC0165It 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.

Description

The p:validate-with-json-schema step is defined in the XProc 3.1: Standard Step Library. It is also described on XProcRef.org.