Skip to content
Permalink
Browse files
Schematron implementation of the Validator API
DAFFODIL-1807
  • Loading branch information
jw3 authored and stevedlawrence committed Dec 2, 2020
1 parent 7037de4 commit d65af5b22a742a09594f277e8154dd4078cf3459
Showing 29 changed files with 6,052 additions and 3 deletions.
30 LICENSE
@@ -355,3 +355,33 @@ subcomponents is subject to the terms and conditions of the following licenses.

XPATH - Copyright © 2007 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
liability, trademark and document use rules apply.

This product bundles content from the Schematron "skeleton" - XSLT implementation, including
the following files:
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_abstract_expand.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_dsdl_include.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_schematron_message_xslt2.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_schematron_skeleton_for_saxon.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_svrl_for_xslt2.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/sch-messages-en.xhtml
The content is available under the MIT License:

Copyright (c) 2004-2010 Rick Jellife and Academia Sinica Computing Centre, Taiwan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -21,7 +21,7 @@ lazy val genSchemas = taskKey[Seq[File]]("Generated DFDL schemas")

lazy val daffodil = Project("daffodil", file(".")).configs(IntegrationTest)
.enablePlugins(JavaUnidocPlugin, ScalaUnidocPlugin)
.aggregate(macroLib, propgen, lib, io, runtime1, runtime1Unparser, core, japi, sapi, tdmlLib, tdmlProc, cli, udf, test, testIBM1, tutorials, testStdLayout)
.aggregate(macroLib, propgen, lib, io, runtime1, runtime1Unparser, core, japi, sapi, tdmlLib, tdmlProc, cli, udf, schematron, test, testIBM1, tutorials, testStdLayout)
.settings(commonSettings, nopublish, ratSettings, unidocSettings)

lazy val macroLib = Project("daffodil-macro-lib", file("daffodil-macro-lib")).configs(IntegrationTest)
@@ -68,13 +68,19 @@ lazy val tdmlProc = Project("daffodil-tdml-processor", file("daffodil-td
.settings(commonSettings)

lazy val cli = Project("daffodil-cli", file("daffodil-cli")).configs(IntegrationTest)
.dependsOn(tdmlProc, sapi, japi, udf % "it->test") // causes sapi/japi to be pulled in to the helper zip/tar
.dependsOn(tdmlProc, sapi, japi, schematron % Runtime, udf % "it->test") // causes sapi/japi to be pulled in to the helper zip/tar
.settings(commonSettings, nopublish)
.settings(libraryDependencies ++= Dependencies.cli)
.settings(libraryDependencies ++= Dependencies.cli)

lazy val udf = Project("daffodil-udf", file("daffodil-udf")).configs(IntegrationTest)
.settings(commonSettings)

lazy val schematron = Project("daffodil-schematron", file("daffodil-schematron"))
.dependsOn(lib)
.settings(commonSettings)
.settings(libraryDependencies ++= Dependencies.schematron)
.configs(IntegrationTest)

lazy val test = Project("daffodil-test", file("daffodil-test")).configs(IntegrationTest)
.dependsOn(tdmlProc, udf % "test->test")
.settings(commonSettings, nopublish)
@@ -846,3 +846,33 @@ subcomponents is subject to the terms and conditions of the following licenses.
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This product bundles content from the Schematron "skeleton" - XSLT implementation, including
the following files:
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_abstract_expand.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_dsdl_include.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_schematron_message_xslt2.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_schematron_skeleton_for_saxon.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/iso_svrl_for_xslt2.xsl
- daffodil-schematron/src/main/resources/iso-schematron-xslt2/sch-messages-en.xhtml
The content is available under the MIT License:

Copyright (c) 2004-2010 Rick Jellife and Academia Sinica Computing Centre, Taiwan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,47 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

Schematron Validation
===

Daffodil Validator API implementation for ISO Schematron in XSLT2

### Configuration

Parameters
- `schematron`: default parameter provides path to the schematron file or resource

### Parse Results

- `SchematronValidationError` on failed rule check

### SPI registration

Registered as `schematron`

`Validators.get("schematron")`

### Command Line Usage

The `schematron` argument to the `--validate` flag will provide the schematron parameter and initiate the parsing.

`daffodil parse --validate schematron=my.sch ...`

### References

- [Camel Schematron Component](https://github.com/apache/camel/tree/4ea9e6c357371682b855d2d79655b41120331b7a/components/camel-schematron).
- [ISO Schematron API](http://schematron.com/schematron-skeleton-api/)

0 comments on commit d65af5b

Please sign in to comment.