moxml 0.5.159 → 0.5.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/_pages/model-coverage.adoc +2 -0
- data/docs/_references/processing-model.adoc +17 -0
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml/xsd.rb +6 -2
- data/spec/moxml/xsd_spec.rb +1 -0
- data/spec/moxml/xsd_underdetection_spec.rb +1 -0
- data/spec/support/model_coverage.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3baac5f598cb14a214bcf65d8f19f7d73d6d70c7f3fc0b53766f07bac4f2d176
|
|
4
|
+
data.tar.gz: 54e53fb3aa363edd679bca122996d5a224bfa58a99e656a35acc59182dd66f45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 705c62afbefc4678ad231e380644023416a5e0cf19e94dd59437c0570abca635e4570db661272490ed1f37804230623d9836e5cc2b8e70619bea1cc16f2fe0a6
|
|
7
|
+
data.tar.gz: e40cf23891b36aaca41bb1c62d01b0e7479c5c1c5eada2fa9563f315399d943a170381d5467019e7e956f06940b71aad59db2d19099a545ebf67d7d4603168c8
|
|
@@ -39,6 +39,8 @@ Generated by `bundle exec rake docs:coverage` from the coverage matrix and the d
|
|
|
39
39
|
| XSLT | equivalent | loud (NotImplementedError) | loud (NotImplementedError) | loud (NotImplementedError) | loud (NotImplementedError) | loud (NotImplementedError) | equivalent
|
|
40
40
|
| SAX | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
41
41
|
| materialization | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
42
|
+
| validation | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
43
|
+
| validation under-detections | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
42
44
|
| loud capability contracts | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent | equivalent
|
|
43
45
|
|===
|
|
44
46
|
|
|
@@ -253,6 +253,23 @@ Pins:: `spec/moxml/plan_conformance_spec.rb`
|
|
|
253
253
|
matching is global; unmatched subtrees are dropped per the pinned
|
|
254
254
|
semantics.
|
|
255
255
|
|
|
256
|
+
=== Validation
|
|
257
|
+
|
|
258
|
+
Pins:: `spec/moxml/xsd_spec.rb`, `spec/moxml/xsd_underdetection_spec.rb`
|
|
259
|
+
|
|
260
|
+
XSD validation through engines that ship a validator (libxml2;
|
|
261
|
+
leptris tier-1: recognized roots, one-level content descent, lexical
|
|
262
|
+
checks). `validate` returns accumulated `ValidationError` entries —
|
|
263
|
+
message always; line/column/path where the engine reports them, nil
|
|
264
|
+
where it does not; `[]` means valid. Documents outside the engine's
|
|
265
|
+
scope validate laxly, except that strict `xs:any` /
|
|
266
|
+
`xs:anyAttribute` wildcard matches and `xsi:nil` are re-checked from
|
|
267
|
+
the schema source on every adapter — the re-check can only
|
|
268
|
+
under-report, never false-report. Unsupported adapters raise
|
|
269
|
+
`Moxml::NotImplementedError` at compile; `Moxml::XSD.supported?`
|
|
270
|
+
answers without raising. RELAX NG rides engines with an RNG face
|
|
271
|
+
(the same shapes).
|
|
272
|
+
|
|
256
273
|
=== Errors and loud degradation
|
|
257
274
|
|
|
258
275
|
Pins:: `spec/consistency/loud_degradation_spec.rb`
|
data/lib/moxml/version.rb
CHANGED
data/lib/moxml/xsd.rb
CHANGED
|
@@ -5,7 +5,10 @@ module Moxml
|
|
|
5
5
|
# an XSD validator (currently leptris, tier-1: named+typed
|
|
6
6
|
# top-level elements, one-level content-model descent, lexical
|
|
7
7
|
# builtin/simpleType checks — see docs/c14n for the sibling
|
|
8
|
-
# pattern).
|
|
8
|
+
# pattern). Beside the engine, SchemaRules re-checks strict
|
|
9
|
+
# wildcards and xsi:nil from the schema source on every adapter —
|
|
10
|
+
# engines that miss those shapes stay model-conformant, and
|
|
11
|
+
# engines that already detect them get no duplicate findings.
|
|
9
12
|
#
|
|
10
13
|
# ctx = Moxml.new(:leptris)
|
|
11
14
|
# schema = ctx.xsd(<<~XSD)
|
|
@@ -24,7 +27,8 @@ module Moxml
|
|
|
24
27
|
# Adapters without an engine raise Moxml::NotImplementedError at
|
|
25
28
|
# compile; Moxml::XSD.supported?(context) answers without
|
|
26
29
|
# raising. The tier-1 scope is the engine's: documents outside it
|
|
27
|
-
# validate laxly
|
|
30
|
+
# validate laxly, except for the re-checked shapes above (which
|
|
31
|
+
# can only under-report, never false-report).
|
|
28
32
|
module XSD
|
|
29
33
|
SUPPORTED_ADAPTERS = %i[leptris nokogiri].freeze
|
|
30
34
|
|
data/spec/moxml/xsd_spec.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "spec_helper"
|
|
4
4
|
|
|
5
|
+
# Processing model §Validation (normative): pinned here.
|
|
5
6
|
# #452: tier-1 engines can accept, inside their recognized scope,
|
|
6
7
|
# instances that violate strict wildcards or xsi:nil. The
|
|
7
8
|
# Ruby-side SchemaRules post-validation closes those gaps from the
|
|
@@ -77,6 +77,14 @@ module ModelCoverage
|
|
|
77
77
|
section: "Materialization",
|
|
78
78
|
pin: "spec/moxml/plan_conformance_spec.rb",
|
|
79
79
|
},
|
|
80
|
+
"validation" => {
|
|
81
|
+
section: "Validation",
|
|
82
|
+
pin: "spec/moxml/xsd_spec.rb",
|
|
83
|
+
},
|
|
84
|
+
"validation under-detections" => {
|
|
85
|
+
section: "Validation",
|
|
86
|
+
pin: "spec/moxml/xsd_underdetection_spec.rb",
|
|
87
|
+
},
|
|
80
88
|
"loud capability contracts" => {
|
|
81
89
|
section: "Errors and loud degradation",
|
|
82
90
|
pin: "spec/consistency/loud_degradation_spec.rb",
|