├── schema ├── README.md ├── LICENSE ├── schematron.sch ├── svrl.rnc ├── schematron.rnc └── svrl.sch └── README.md /schema/README.md: -------------------------------------------------------------------------------- 1 | # schema 2 | Unofficial, development copy of schema(s) for Schematron. 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Schematron Enhancement Proposals 2 | 3 | This repository collects proposals to enhance Schematron beyond the ISO specification. One goal of this repository is to 4 | decouple proposed enhancements to the Schematron from its implementations. 5 | 6 | The changes are worked out in more detail in the [wiki](https://github.com/Schematron/schematron-enhancement-proposals/wiki) 7 | -------------------------------------------------------------------------------- /schema/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © ISO/IEC 2017 2 | The following permission notice and disclaimer shall be included in all 3 | copies of this XML schema ("the Schema"), and derivations of the Schema: 4 | 5 | Permission is hereby granted, free of charge in perpetuity, to any 6 | person obtaining a copy of the Schema, to use, copy, modify, merge and 7 | distribute free of charge, copies of the Schema for the purposes of 8 | developing, implementing, installing and using software based on the 9 | Schema, and to permit persons to whom the Schema is furnished to do so, 10 | subject to the following conditions: 11 | 12 | THE SCHEMA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 16 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 17 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SCHEMA OR THE USE OR 18 | OTHER DEALINGS IN THE SCHEMA. 19 | 20 | In addition, any modified copy of the Schema shall include the following 21 | notice: 22 | 23 | "THIS SCHEMA HAS BEEN MODIFIED FROM THE SCHEMA DEFINED IN ISO/IEC 19757 3, 24 | AND SHOULD NOT BE INTERPRETED AS COMPLYING WITH THAT STANDARD". 25 | -------------------------------------------------------------------------------- /schema/schematron.sch: -------------------------------------------------------------------------------- 1 | 23 | 24 | 25 | Schema for Additional Constraints in Schematron 26 | 27 | This schema supplies some constraints in addition to those given in the 28 | ISO/IEC 19757 2 29 | (RELAX NG Compact Syntax) Schema for Schematron. 30 | 31 | 32 | The pattern 33 | attribute of the active element shall match the id 34 | attribute of a pattern. 35 | 36 | 37 | The 38 | is-a attribute of a pattern element shall match 39 | the id attribute of an abstract pattern. 40 | 41 | 42 | 43 | The rule 44 | attribute of an extends element shall match the id 45 | attribute of an abstract rule. 46 | 47 | 48 | 49 | A variable name and an abstract pattern parameter should not use the 53 | same name. 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /schema/svrl.rnc: -------------------------------------------------------------------------------- 1 | # Copyright © ISO/IEC 2019 2 | # 3 | # The following permission notice and disclaimer shall be included in all 4 | # copies of this XML schema ("the Schema"), and derivations of the Schema: 5 | # Permission is hereby granted, free of charge in perpetuity, to any 6 | # person obtaining a copy of the Schema, to use, copy, modify, merge and 7 | # distribute free of charge, copies of the Schema for the purposes of 8 | # developing, implementing, installing and using software based on the 9 | # Schema, and to permit persons to whom the Schema is furnished to do so, 10 | # subject to the following conditions: 11 | # 12 | # THE SCHEMA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 16 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 17 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SCHEMA OR THE USE OR 18 | # OTHER DEALINGS IN THE SCHEMA. 19 | # 20 | # In addition, any modified copy of the Schema shall include the following 21 | # notice: 22 | # 23 | # THIS SCHEMA HAS BEEN MODIFIED FROM THE SCHEMA DEFINED IN ISO/IEC 19757-3, 24 | # AND SHOULD NOT BE INTERPRETED AS COMPLYING WITH THAT STANDARD." 25 | 26 | namespace local = "" 27 | default namespace svrl = "http://purl.oclc.org/dsdl/svrl" 28 | 29 | 30 | schematron-output = 31 | element schematron-output { 32 | attribute title { text }?, 33 | attribute phase { xsd:NMTOKEN }?, 34 | attribute schemaVersion { text }?, 35 | human-text*, 36 | ns-prefix-in-attribute-values*, 37 | (active-pattern, 38 | (fired-rule, (failed-assert | successful-report)*)*)+ 39 | } 40 | # only namespaces from sch:ns need to be reported 41 | ns-prefix-in-attribute-values = 42 | element ns-prefix-in-attribute-values { 43 | attribute prefix { xsd:NMTOKEN }, 44 | attribute uri { text }, 45 | empty 46 | } 47 | # only active patterns are reported 48 | active-pattern = 49 | element active-pattern { 50 | attribute id { xsd:NCName }?, 51 | attribute documents { text }?, 52 | attribute name { text }?, 53 | attribute role { string }?, 54 | empty 55 | } 56 | # only rules that are fired are reported, 57 | fired-rule = 58 | element fired-rule { 59 | attribute id { xsd:NCName }?, 60 | attribute name { text }?, 61 | attribute context { text }, 62 | attribute role { string }?, 63 | attribute flag { string }?, 64 | attribute document { xsd:anyURI }?, 65 | empty 66 | } 67 | # only references are reported, not the diagnostic 68 | diagnostic-reference = 69 | element diagnostic-reference { 70 | attribute diagnostic { xsd:NMTOKEN }, 71 | human-text 72 | } 73 | # only failed assertions are reported 74 | failed-assert = 75 | element failed-assert { 76 | attlist.assert-and-report, diagnostic-reference*, property-reference*, human-text 77 | } 78 | # only successful asserts are reported 79 | successful-report = 80 | element successful-report { 81 | attlist.assert-and-report, diagnostic-reference*, property-reference*, human-text 82 | } 83 | # property-reference 84 | property-reference = 85 | element property-reference { 86 | attribute property { xsd:NMTOKEN }, 87 | attribute role { text }?, 88 | attribute scheme { text }?, 89 | human-text 90 | } 91 | # human text 92 | human-text = 93 | element text { 94 | attribute xml:space { text }?, 95 | attribute xml:lang { text }?, 96 | attribute see { text }?, 97 | attribute icon { text }?, 98 | attribute fpi { text }?, 99 | rich-text 100 | } 101 | # rich text 102 | rich-text = (foreign | dir | span | emph | text)* 103 | # directionality 104 | dir = 105 | element dir { 106 | attribute class { text }?, 107 | attribute dir { text }?, 108 | text 109 | } 110 | # emphasis 111 | emph = 112 | element emph { 113 | attribute class { text }?, 114 | text 115 | } 116 | # arbitrary markup 117 | span = 118 | element span { 119 | attribute class { text }, 120 | text 121 | } 122 | # foreign 123 | foreign = foreign-attributes | foreign-element 124 | foreign-attributes = attribute * - (xml:* | local:*) { text }* 125 | foreign-element = 126 | element * - svrl:* { 127 | (attribute * { text } 128 | | foreign-element 129 | | text)* 130 | } 131 | attlist.assert-and-report = 132 | attribute id { xsd:NCName }?, 133 | attribute location { text }, 134 | attribute test { text }, 135 | attribute role { string }?, 136 | attribute flag { string }? 137 | start = schematron-output -------------------------------------------------------------------------------- /schema/schematron.rnc: -------------------------------------------------------------------------------- 1 | # Copyright © ISO/IEC 2017 2 | # The following permission notice and disclaimer shall be included in all 3 | # copies of this XML schema ("the Schema"), and derivations of the Schema: 4 | 5 | # Permission is hereby granted, free of charge in perpetuity, to any 6 | # person obtaining a copy of the Schema, to use, copy, modify, merge and 7 | # distribute free of charge, copies of the Schema for the purposes of 8 | # developing, implementing, installing and using software based on the 9 | # Schema, and to permit persons to whom the Schema is furnished to do so, 10 | # subject to the following conditions: 11 | 12 | # THE SCHEMA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 15 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 16 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 17 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SCHEMA OR THE USE OR 18 | # OTHER DEALINGS IN THE SCHEMA. 19 | 20 | # In addition, any modified copy of the Schema shall include the following 21 | # notice: 22 | 23 | # "THIS SCHEMA HAS BEEN MODIFIED FROM THE SCHEMA DEFINED IN ISO/IEC 19757 3, 24 | # AND SHOULD NOT BE INTERPRETED AS COMPLYING WITH THAT STANDARD". 25 | 26 | namespace local = "" 27 | default namespace sch = "http://purl.oclc.org/dsdl/schematron" 28 | 29 | start = schema 30 | 31 | # Element declarations 32 | schema = 33 | element schema { 34 | attribute id { xsd:ID }?, 35 | rich, 36 | attribute schemaVersion { non-empty-string }?, 37 | attribute defaultPhase { xsd:IDREF }?, 38 | attribute queryBinding { non-empty-string }?, 39 | (foreign 40 | & inclusion* 41 | & (title?, ns*, p*, let*, phase*, pattern+, p*, diagnostics?, properties?)) 42 | } 43 | active = 44 | element active { 45 | attribute pattern { xsd:IDREF }, 46 | (foreign & (text | dir | emph | span)*) 47 | } 48 | assert = 49 | element assert { 50 | attribute test { exprValue }, 51 | attribute flag { flagValue }?, 52 | attribute id { xsd:ID }?, 53 | attribute diagnostics { xsd:IDREFS }?, 54 | attribute properties { xsd:IDREFS }?, 55 | rich, 56 | linkable, 57 | (foreign & (text | name | value-of | emph | dir | span)*) 58 | } 59 | diagnostic = 60 | element diagnostic { 61 | attribute id { xsd:ID }, 62 | attribute role { roleValue }?, 63 | rich, 64 | (foreign & (text | value-of | emph | dir | span)*) 65 | } 66 | diagnostics = element diagnostics { foreign & inclusion* & diagnostic* } 67 | dir = 68 | element dir { 69 | attribute value { "ltr" | "rtl" }?, 70 | (foreign & text) 71 | } 72 | emph = element emph { text } 73 | extends = 74 | element extends { 75 | (attribute rule { xsd:IDREF } 76 | | attribute href { uriValue }), 77 | foreign-empty 78 | } 79 | let = 80 | element let { 81 | attribute name { nameValue }, 82 | (attribute value { string } 83 | | foreign-element+) 84 | } 85 | name = 86 | element name { 87 | attribute path { pathValue }?, 88 | foreign-empty 89 | } 90 | ns = 91 | element ns { 92 | attribute uri { uriValue }, 93 | attribute prefix { nameValue }, 94 | foreign-empty 95 | } 96 | p = 97 | element p { 98 | attribute id { xsd:ID }?, 99 | attribute class { classValue }?, 100 | attribute icon { uriValue }?, 101 | (foreign & (text | dir | emph | span)*) 102 | } 103 | param = 104 | element param { 105 | attribute name { nameValue }, 106 | attribute value { non-empty-string } 107 | } 108 | 109 | pattern = 110 | element pattern { 111 | attribute documents { pathValue }?, 112 | rich, 113 | (foreign 114 | & inclusion* 115 | & ((attribute abstract { "true" }, 116 | attribute id { xsd:ID }, 117 | title?, 118 | (p*, let*, rule*)) 119 | | (attribute abstract { "false" }?, 120 | attribute id { xsd:ID }?, 121 | title?, 122 | (p*, let*, rule*)) 123 | | (attribute abstract { "false" }?, 124 | attribute is-a { xsd:IDREF }, 125 | attribute id { xsd:ID }?, 126 | title?, 127 | (p*, param*)))) 128 | } 129 | phase = 130 | element phase { 131 | attribute id { xsd:ID }, 132 | rich, 133 | (foreign & inclusion* & (p*, let*, active*)) 134 | } 135 | properties = element properties { property* } 136 | property = 137 | element property { 138 | attribute id { xsd:ID }, 139 | attribute role { roleValue }?, 140 | attribute scheme { text }?, 141 | (foreign & (text | name | value-of | emph | dir | span)*) 142 | } 143 | report = 144 | element report { 145 | attribute test { exprValue }, 146 | attribute flag { flagValue }?, 147 | attribute id { xsd:ID }?, 148 | attribute diagnostics { xsd:IDREFS }?, 149 | attribute properties { xsd:IDREFS }?, 150 | rich, 151 | linkable, 152 | (foreign & (text | name | value-of | emph | dir | span)*) 153 | } 154 | rule = 155 | element rule { 156 | attribute flag { flagValue }?, 157 | rich, 158 | linkable, 159 | (foreign 160 | & inclusion* 161 | & ((attribute abstract { "true" }, 162 | attribute id { xsd:ID }, 163 | let*, 164 | (assert | report | extends | p)+) 165 | | (attribute context { pathValue }, 166 | attribute id { xsd:ID }?, 167 | attribute abstract { "false" }?, 168 | let*, 169 | (assert | report | extends | p)+))) 170 | } 171 | span = 172 | element span { 173 | attribute class { classValue }, 174 | (foreign & text) 175 | } 176 | title = element title { (text | dir)* } 177 | value-of = 178 | element value-of { 179 | attribute select { pathValue }, 180 | foreign-empty 181 | } 182 | 183 | # common declarations 184 | inclusion = 185 | element include { 186 | attribute href { uriValue }, 187 | foreign-empty 188 | } 189 | rich = 190 | attribute icon { uriValue }?, 191 | attribute see { uriValue }?, 192 | attribute fpi { fpiValue }?, 193 | attribute xml:lang { langValue }?, 194 | attribute xml:space { "preserve" | "default" }? 195 | linkable = 196 | attribute role { roleValue }?, 197 | attribute subject { pathValue }? 198 | foreign = foreign-attributes, foreign-element* 199 | foreign-empty = foreign-attributes 200 | foreign-attributes = attribute * - (local:* | xml:*) { text }* 201 | foreign-element = 202 | element * - sch:* { 203 | (attribute * { text } 204 | | foreign-element 205 | | schema 206 | | text)* 207 | } 208 | 209 | # Data types 210 | uriValue = xsd:anyURI 211 | pathValue = string 212 | exprValue = string 213 | fpiValue = string 214 | langValue = xsd:language 215 | roleValue = string 216 | flagValue = string 217 | nameValue = string 218 | 219 | # In the default query language binding, xsd:NCNAME 220 | classValue = string 221 | non-empty-string = xsd:token { minLength = "1" } 222 | -------------------------------------------------------------------------------- /schema/svrl.sch: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | Schema for Schematron Validation Report Language 27 | 28 | The Schematron Validation Report Language is a simple language 29 | for implementations to use to compare their conformance. It is 30 | basically a list of all the assertions that fail when validating 31 | a document, in any order, together with other information such as 32 | which rules fire. 33 | This schema can be used to validate SVRL documents, and provides examples 34 | of the use of abstract rules and abstract patterns. 35 | 36 | Elements 37 | 38 | 39 | The element is a 40 | child of schematron-output. 41 | 42 | 43 | The element should not contain 44 | any elements. 45 | 46 | 47 | 48 | 49 | The 50 | element should be empty. 51 | 52 | 53 | 54 | The element is the root element. 55 | 56 | 59 | may only contain the following elements: text, 60 | ns-prefix-in-attribute-values, active-pattern, fired-rule, failed-assert and 61 | successful-report. 62 | 63 | should have at least one active pattern. 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | should have a diagnostic attribute, giving the id of 72 | the diagnostic. 73 | 74 | 75 | 76 | 77 | 78 | A comes before an active-pattern or another 82 | ns-prefix-in-attribute-values element. 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | A comes after an active-pattern, an empty fired-rule, 97 | a failed-assert or a successful report. 98 | The element 99 | should have a context attribute giving the current 100 | context, in simple XPath format. 101 | 102 | 103 | 104 | The element should only contain a 106 | text element and diagnostic reference elements. 107 | The element should only 108 | contain a text element. 109 | A comes after a fired-rule, a failed-assert or a successful- 114 | report. 115 | 116 | 117 | 118 | 119 | An unknown element has been used. 120 | 121 | 122 | 123 | 124 | Unique Ids 125 | 126 | Id attributes 127 | should be unique in a document. 128 | 129 | 130 | 131 | Required Attributes 132 | 133 | The element 134 | should have a attribute. 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | --------------------------------------------------------------------------------