Skip to content

Commit

Permalink
Add Schematron for path checking and update incorrect paths. (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-stein-nist authored and david-waltermire committed Dec 7, 2022
1 parent 371a217 commit 21383fb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion toolchains/xslt-M4/make-metaschema-css.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Import (subpipeline) -->

<p:import href="metaschema-compose.xpl"/>
<p:import href="compose/metaschema-compose.xpl"/>

<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Pipeline -->
Expand Down
14 changes: 2 additions & 12 deletions toolchains/xslt-M4/make-metaschema-sandbox.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Import (subpipeline) -->

<p:import href="metaschema-compose.xpl"/>
<p:import href="compose/metaschema-compose.xpl"/>

<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Pipeline -->
Expand All @@ -58,15 +58,5 @@
<metaschema:metaschema-compose name="compose"/>

<p:identity name="composed"/>

<!--<p:identity name="render-xml-model-map"/>-->
<p:xslt name="make-definition-map">
<p:input port="source">
<p:pipe port="result" step="composed"/>
</p:input>
<p:input port="stylesheet">
<p:document href="compose/make-definition-map.xsl"/>
</p:input>
</p:xslt>


</p:declare-step>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Import (subpipeline) -->

<p:import href="metaschema-compose.xpl"/>
<p:import href="compose/metaschema-compose.xpl"/>

<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Pipeline -->
Expand Down
2 changes: 1 addition & 1 deletion toolchains/xslt-M4/schema-gen/make-json-schema-metamap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
-->
<!-- Produces composed metaschema (imports resolved) -->
<!--<xsl:import href="../lib/metaschema-compose.xsl"/>-->
<!--<xsl:import href="../nist-metaschema-COMPOSE.xsl"/>
<xsl:variable name="composed-metaschema" select="/"/>
<!-- bypasses composition to operate on the 'raw' metaschema for debugging -->
Expand Down
4 changes: 2 additions & 2 deletions toolchains/xslt-M4/testing/test-xml-conversions.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Import (subpipeline) -->

<p:import href="../metaschema-compose.xpl"/>
<p:import href="../compose/metaschema-compose.xpl"/>

<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Pipeline -->
Expand Down Expand Up @@ -159,7 +159,7 @@
<!--<p:identity name="serialize-json"/>-->
<p:xslt name="serialize-json">
<p:input port="stylesheet">
<p:document href="../lib/xpath-json-to-json.xsl"/>
<p:document href="../util/xpath-json-to-json.xsl"/>
</p:input>
</p:xslt>

Expand Down
11 changes: 11 additions & 0 deletions toolchains/xslt-M4/validate/xproc-check.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:p="http://www.w3.org/ns/xproc"
xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
<sch:ns uri="http://www.w3.org/ns/xproc" prefix="p"/>
<sch:pattern>
<sch:rule context="//(p:document|p:import)/@href">
<sch:assert role="fatal" test="doc-available(resolve-uri(current(), document-uri(/)))" id="xpl-import-bad-href-target">No XML document at target location <sch:value-of select="resolve-uri(current(), document-uri(/))"/>.</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>

0 comments on commit 21383fb

Please sign in to comment.