sbf
Schematron Batch Fixes
| Git URL | https://github.com/transpect/sbf.git |
| SVN URL | https://github.com/transpect/sbf |
| Base URI | http://transpect.io/sbf/ |
sbf:assemble-schematron
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/assemble-schematron/assemble-schematron.xpl"/>
Synopsis
<sbf:assemble-schematron xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="source" primary="true"/>
<p:input port="xslt"/>
<p:output port="result" primary="true"/>
</sbf:assemble-schematron>
sbf:expand-schema
Read, expand and optionally cache Schema (NVDL or Schematron) a. For NVDL, include assembled Schematron schemas referenced by validation/@schema below the validation elements. b. Assemble Schematron(s), either the primary input Schematron or each referenced Schematron. For the latter, the assembled Schematron will then be stored below validation. c. Optionally store the expanded schema
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/expand-schema/expand-schema.xpl"/>
Dependencies
Synopsis
<sbf:expand-schema xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="source" primary="true"/>
<p:output port="result" primary="true"/>
</sbf:expand-schema>
sbf:enrich-archive-manifest
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/find-files/enrich-archive-manifest.xpl"/>
Dependencies
Synopsis
<sbf:enrich-archive-manifest xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="source" primary="true"/>
<p:output port="result" primary="true"/>
<p:output port="contents" sequence="true"/>
<p:option name="debug-dir-uri" select="''"/>
<p:option name="debug" select="'no'"/>
</sbf:enrich-archive-manifest>
sbf:merge-into-archive-manifest
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/helper/merge-into-archive-manifest.xpl"/>
Synopsis
<sbf:merge-into-archive-manifest xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="source" primary="true"/>
<p:input port="insertions" sequence="true"/>
<p:output port="result" primary="true"/>
</sbf:merge-into-archive-manifest>
sbf:params-to-json
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/helper/params-to-json.xpl"/>
Synopsis
<sbf:params-to-json xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="source" sequence="true"/>
<p:output port="result" sequence="true"/>
<p:option name="key-type" select="'QName'"/>
</sbf:params-to-json>
sbf:render
Will try to load the rendering pipeline that is specified in /nvdl:rules/nvdl:namespace/sbf:rendering-pipeline/@href and apply it to the fixed XML.
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/render/render.xpl"/>
Dependencies
Synopsis
<sbf:render xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="schema"/>
<p:input port="source" primary="true"/>
<p:input port="archive-data-uri-map"/>
<p:output port="result" sequence="true" primary="true"/>
<p:option name="debug-dir-uri" select="''"/>
<p:option name="debug" select="'no'"/>
</sbf:render>
sbf:add-srcpaths
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/validate/add-srcpaths.xpl"/>
Dependencies
Synopsis
<sbf:add-srcpaths xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="source" primary="true"/>
<p:output port="result" primary="true"/>
<p:option name="debug-dir-uri" select="''"/>
<p:option name="debug" select="'no'"/>
</sbf:add-srcpaths>
sbf:apply-fixes
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/validate/apply-fixes.xpl"/>
Dependencies
Synopsis
<sbf:apply-fixes xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="fixes-list" primary="true"/>
<p:input port="source"/>
<p:input port="contents" sequence="true"/>
<p:output port="result" primary="true"/>
<p:output port="result-contents" sequence="true"/>
<p:option name="debug-dir-uri" select="''"/>
<p:option name="debug" select="'no'"/>
</sbf:apply-fixes>
sbf:fixes-list
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/validate/fixes-list.xpl"/>
Dependencies
Synopsis
<sbf:fixes-list xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="svrl" primary="true"/>
<p:input port="schema"/>
<p:output port="result" primary="true"/>
<p:option name="debug-dir-uri" select="''"/>
<p:option name="debug" select="'no'"/>
</sbf:fixes-list>
sbf:schematron-for-namespace
Will select schemas for the given namespace from NVDL, or, if Schematron is supplied instead of NVDL, will use this Schematron. In both cases, the schematron is expected to be assembled already (sbf:extends are expanded), and in the case of NVDL the expanded Schematron schema is included below nvdl:namespace/nvdl:validate. Although this step is called schematron-for-namespace, it is planned that additional schema validations, before or after the fixes have been applied, can be performed. These future validations may be either specified by additional nvdl:validate instructions or by acting on the document’s DOCTYPE, xsi attributes, or xml-model PIs, pre- and/or post-fix.
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/validate/schematron-for-namespace.xpl"/>
Dependencies
Synopsis
<sbf:schematron-for-namespace xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="schema"/>
<p:input port="source" primary="true"/>
<p:input port="contents" sequence="true"/>
<p:input port="archive-data-uri-map"/>
<p:output port="result" primary="true"/>
<p:output port="result-contents" sequence="true"/>
<p:output port="report" sequence="true"/>
<p:output port="rendering" sequence="true"/>
<p:option name="debug-dir-uri" select="''"/>
<p:option name="debug" select="'no'"/>
</sbf:schematron-for-namespace>
sbf:batch-val
0. Read and expand Schema (NVDL or Schematron). For speed-up, an already expanded schema can be passed to the step. a. Enrich NVDL schema with assembled versions of Schematron files referred by validation/@schema's. (Schematron assembly means: Expansion of the sbf:extends instructions.) b. If input is just Schematron, assemble it. 1. Load input (by URI or input port): a. For Zip input, get/enrich manifest (→ result) and contents from source Enrichment: aa. Determine namespace URI for XML files bb. Include XML files below c:entry so that the manifest Schematron can, for instance, compare c:entry hrefs with graphic filenames (Optionally, perform DTD, XSD, or xml-model based non-Schematron schema validation when or after loading the files and record c:errors document below the same c:entry; c:errors may also be created when an XML document isn’t well-formed.) b. For XML input, use source (→ result) 2. look up DRP's namespace (xproc-step for zip/directory processing or other for XML input (where input can also be an XMLized representation of image properties, for instance – then XProc fixes can convert these images from TIFF to PNG, for instance). This item 2. is encapsulated in sbf:schematron-for-namespace 2.1 select Schematron from NVDL according to this NS If there is no NVDL, just Schematron, on the schema port, use the Schematron. Both standalone and embedded-in-NVDL Schematron are expected to be sbf:extends-expanded. 2.2 If ∃ Schematron: a. add srcpath to the source document (except for archive manifests?) b. validate doc, set SVRL base URI so that it can be associated with validated file (append '.val' to URI), send SVRL to report port, send doc to result port, send potential zip content stream to content port 2.3 Collect all fixes from the SVRLs, group them by SVRL base URI This item 2.3 is encapsulated as sbf:apply-fixes 2.3.1 Create fix execution plan for each document URI (calculated from SVRL URI), observing dependencies among fixes (but only for the same document) 2.3.2 Apply fixes to the documents, each fix operates on the previous fix's output. XProc fixes operate on manifest doc + contents 2.4 Validate each doc again, collect SVRL Check whether an error that had been reported for a given srcpath (or href, for manifest documents) is still being reported 3. If source is archive manifest: a. viewport all c:entries with NS (if there are none, the process is finished and returns the input unchanged): b. apply 2. to this input (do we support archives in archives? not yet) 4. Create HTML and brief report
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/validate/validate.xpl"/>
Dependencies
Synopsis
<sbf:batch-val xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="schema"/>
<p:input port="source" sequence="true" primary="true"/>
<p:input port="svrl2html"/>
<p:output port="result" primary="true"/>
<p:output port="input"/>
<p:output port="report" sequence="true"/>
<p:output port="result-contents" sequence="true"/>
<p:output port="htmlreport"/>
<p:output port="rendering" sequence="true"/>
<p:option name="input-uri" required="false"/>
<p:option name="keep-srcpath" select="'pi_changed'"/>
<p:option name="debug-dir"/>
<p:option name="debug" select="'no'"/>
<p:option name="output-dir" select="'out'"/>
<p:option name="rendering-only" select="false()"/>
</sbf:batch-val>
sbf:validation-archive
For input port (and for $input-uri) documentation, see validate.xpl
Import
<p:import href="https://raw.githubusercontent.com/transpect/sbf/main/validate/validation-archive.xpl"/>
Dependencies
Synopsis
<sbf:validation-archive xmlns:sbf="http://transpect.io/schematron-batch-fix">
<p:input port="schema"/>
<p:input port="source" sequence="true" primary="true"/>
<p:input port="svrl2html"/>
<p:output port="result" primary="true"/>
<p:option name="input-uri" required="false"/>
<p:option name="keep-srcpath" select="'pi_changed'"/>
<p:option name="debug-dir"/>
<p:option name="debug" select="'no'"/>
</sbf:validation-archive>
GitHub sync date: 2026-10-19+02:00