From 3f2d2c0e15aaacae6caad76e49db08bc1235a8e3 Mon Sep 17 00:00:00 2001 From: Justin McNamara Date: Thu, 19 Apr 2018 09:11:12 -0400 Subject: [PATCH 1/2] Created README.md Created a more human readable version of the `readme.txt` --- trunk/schematron/code/README.md | 101 ++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 trunk/schematron/code/README.md diff --git a/trunk/schematron/code/README.md b/trunk/schematron/code/README.md new file mode 100644 index 0000000..c8fbd49 --- /dev/null +++ b/trunk/schematron/code/README.md @@ -0,0 +1,101 @@ +## ISO SCHEMATRON 2010 + +`XSLT` implementation by Rick Jelliffe with assistance from members of Schematron-love-in maillist. + +2010-04-21 + +##### Two distributions are available. One is for `XSLT1` engines. The other is for `XSLT2` engines, such as `SAXON 9`. + + +This version of Schematron splits the process into a pipeline of several different `XSLT` stages. + +1) First, preprocess your Schematron schema with `iso_dsdl_include.xsl`. +This is a macro processor to assemble the schema from various parts. +If your schema is not in separate parts, you can skip this stage. +This stage also generates error messages for some common `XPath` syntax problems. + +2) Second, preprocess the output from stage 1 with `iso_abstract_expand.xsl`. +This is a macro processor to convert abstract patterns to real patterns. +If your schema does not use abstract patterns, you can skip this +stage. + +3) Third, compile the Schematron schema into an `XSLT` script. +This will typically use iso_svrl_for_xslt1.xsl or iso_svrl_for_xslt2.xsl +(which in turn invoke `iso_schematron_skeleton_for_xslt1.xsl` or `iso_schematron_skeleton_for_saxon.xsl`) +However, other "meta-stylesheets" are also in common use; the principle of operation is the same. +If your schema uses Schematron phases, supply these as command line/invocation parameters +to this process. + +4) Fourth, run the script generated by stage 3 against the document being validated. +If you are using the SVRL script, then the output of validation will be an `XML` document. +If your schema uses Schematron parameters, supply these as command line/invocation parameters +to this process. + + +The XSLT2 distribution also features several next generation features, +such as validating multiple documents. See the source code for details. + +Schematron assertions can be written in any language, of course; the file +`sch-messages-en.xhtml` contains the diagnostics messages from the `XSLT2` skeleton +in English, and this can be used as template to localize the skeleton's +error messages. Note that typically programming errors in Schematron are XPath +errors, which requires localized messages from the `XSLT` engine. + +ANT +--- +To give an example of how to process a document, here is a sample ANT task. + +```XML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + + EXTRACTION SCHEMATRON FROM `XSD` OR `RELAX NG` + + The following files allow extracting of embedded schematron patterns + in XML Schemas or RELAX NG schemas. For details, see the at + article http://www.topologi.com/resources/schtrn_xsd_paper.html + + The following files are provided: + + ExtractSchFromRNG.xsl Generate a Schematron schema from patterns + embedded in a RELAX NG schema. The schema uses XSLT1. + ExtractSchFromXSD.xsl Generate a Schematron schema from patterns + embedded in a W3C XML Schemas schema. The schema uses XSLT1. + + ExtractSchFromRNG-2.xsl Generate a Schematron schema from patterns + embedded in a RELAX NG schema. The schema uses XSLT2. + ExtractSchFromXSD-2.xsl Generate a Schematron schema from patterns + embedded in a W3C XML Schemas schema. The schema uses XSLT2. From 47bd06cc0beb0867ca77a9d27efe0f4f333847f4 Mon Sep 17 00:00:00 2001 From: Tony Graham Date: Sun, 10 Jun 2018 13:31:15 +0000 Subject: [PATCH 2/2] Update README.md Acronyms don't need to be `code`. Different guess at headings. Reworked last list. --- trunk/schematron/code/README.md | 41 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/trunk/schematron/code/README.md b/trunk/schematron/code/README.md index c8fbd49..1709392 100644 --- a/trunk/schematron/code/README.md +++ b/trunk/schematron/code/README.md @@ -1,33 +1,33 @@ -## ISO SCHEMATRON 2010 +# ISO SCHEMATRON 2010 -`XSLT` implementation by Rick Jelliffe with assistance from members of Schematron-love-in maillist. +XSLT implementation by Rick Jelliffe with assistance from members of Schematron-love-in maillist. -2010-04-21 +## 2010-04-21 -##### Two distributions are available. One is for `XSLT1` engines. The other is for `XSLT2` engines, such as `SAXON 9`. +##### Two distributions are available. One is for XSLT1 engines. The other is for XSLT2 engines, such as SAXON 9. -This version of Schematron splits the process into a pipeline of several different `XSLT` stages. +This version of Schematron splits the process into a pipeline of several different XSLT stages. 1) First, preprocess your Schematron schema with `iso_dsdl_include.xsl`. This is a macro processor to assemble the schema from various parts. If your schema is not in separate parts, you can skip this stage. -This stage also generates error messages for some common `XPath` syntax problems. +This stage also generates error messages for some common XPath syntax problems. 2) Second, preprocess the output from stage 1 with `iso_abstract_expand.xsl`. This is a macro processor to convert abstract patterns to real patterns. If your schema does not use abstract patterns, you can skip this stage. -3) Third, compile the Schematron schema into an `XSLT` script. -This will typically use iso_svrl_for_xslt1.xsl or iso_svrl_for_xslt2.xsl +3) Third, compile the Schematron schema into an XSLT script. +This will typically use `iso_svrl_for_xslt1.xsl` or `iso_svrl_for_xslt2.xsl` (which in turn invoke `iso_schematron_skeleton_for_xslt1.xsl` or `iso_schematron_skeleton_for_saxon.xsl`) However, other "meta-stylesheets" are also in common use; the principle of operation is the same. If your schema uses Schematron phases, supply these as command line/invocation parameters to this process. 4) Fourth, run the script generated by stage 3 against the document being validated. -If you are using the SVRL script, then the output of validation will be an `XML` document. +If you are using the SVRL script, then the output of validation will be an XML document. If your schema uses Schematron parameters, supply these as command line/invocation parameters to this process. @@ -36,13 +36,13 @@ The XSLT2 distribution also features several next generation features, such as validating multiple documents. See the source code for details. Schematron assertions can be written in any language, of course; the file -`sch-messages-en.xhtml` contains the diagnostics messages from the `XSLT2` skeleton +`sch-messages-en.xhtml` contains the diagnostics messages from the XSLT2 skeleton in English, and this can be used as template to localize the skeleton's error messages. Note that typically programming errors in Schematron are XPath -errors, which requires localized messages from the `XSLT` engine. +errors, which requires localized messages from the XSLT engine. + +## ANT -ANT ---- To give an example of how to process a document, here is a sample ANT task. ```XML @@ -82,7 +82,7 @@ To give an example of how to process a document, here is a sample ANT task. ``` - EXTRACTION SCHEMATRON FROM `XSD` OR `RELAX NG` +## Extracting Schematron from XSD or RELAX NG The following files allow extracting of embedded schematron patterns in XML Schemas or RELAX NG schemas. For details, see the at @@ -90,12 +90,7 @@ To give an example of how to process a document, here is a sample ANT task. The following files are provided: - ExtractSchFromRNG.xsl Generate a Schematron schema from patterns - embedded in a RELAX NG schema. The schema uses XSLT1. - ExtractSchFromXSD.xsl Generate a Schematron schema from patterns - embedded in a W3C XML Schemas schema. The schema uses XSLT1. - - ExtractSchFromRNG-2.xsl Generate a Schematron schema from patterns - embedded in a RELAX NG schema. The schema uses XSLT2. - ExtractSchFromXSD-2.xsl Generate a Schematron schema from patterns - embedded in a W3C XML Schemas schema. The schema uses XSLT2. +- `ExtractSchFromRNG.xsl` - Generate a Schematron schema from patterns embedded in a RELAX NG schema. The schema uses XSLT1. +- `ExtractSchFromXSD.xsl` - Generate a Schematron schema from patterns embedded in a W3C XML Schemas schema. The schema uses XSLT1. +- `ExtractSchFromRNG-2.xsl` - Generate a Schematron schema from patterns embedded in a RELAX NG schema. The schema uses XSLT2. +- `ExtractSchFromXSD-2.xsl` - Generate a Schematron schema from patterns embedded in a W3C XML Schemas schema. The schema uses XSLT2.