moxml 0.5.166 → 0.5.168

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.
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ # Processing model §Validation (normative): pinned here.
6
+ # moxml#460 items 1-2: the engine's metadata routes through the
7
+ # facade. On bindings predating the faces the probes answer nil and
8
+ # the facade degrades exactly as before (rules heuristic / flat
9
+ # errors) — the degradation is part of the contract.
10
+ RSpec.describe "Moxml::XSD engine metadata" do
11
+ let(:context) { Moxml.new(:leptris) }
12
+
13
+ describe "degradation on faces-less adapters" do
14
+ it "answers the source-derived version and nil structured rows" do
15
+ ctx = Moxml.new(:nokogiri)
16
+ skip "nokogiri requires an XSD-capable engine" unless
17
+ Moxml::XSD.supported?(ctx)
18
+ schema = ctx.xsd(
19
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" version=\"1.1\"><xs:element name=\"e\" type=\"xs:string\"/></xs:schema>",
20
+ )
21
+ expect(schema.version).to eq("1.0")
22
+ expect(schema.structured_errors("<e/>")).to be_nil
23
+ end
24
+ end
25
+
26
+ describe "Schema#version" do
27
+ it "answers 1.1 for a 1.1-tagged schema when the binding serves it" do
28
+ schema = context.xsd(
29
+ '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ' \
30
+ 'version="1.1">' \
31
+ '<xs:element name="e" type="xs:string"/></xs:schema>',
32
+ )
33
+ v = schema.version
34
+ expect(v).to eq("1.1").or eq("1.0")
35
+ end
36
+
37
+ it "answers 1.0 for an untagged schema" do
38
+ schema = context.xsd(
39
+ '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">' \
40
+ '<xs:element name="e" type="xs:string"/></xs:schema>',
41
+ )
42
+ expect(schema.version).to eq("1.0")
43
+ end
44
+ end
45
+
46
+ describe "Schema#structured_errors" do
47
+ it "returns rows with kind/component when the binding serves it" do
48
+ schema = context.xsd(
49
+ '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">' \
50
+ '<xs:element name="note">' \
51
+ "<xs:complexType><xs:sequence>" \
52
+ '<xs:element name="to" type="xs:string"/>' \
53
+ "</xs:sequence></xs:complexType>" \
54
+ "</xs:element></xs:schema>",
55
+ )
56
+ # a WRONG child, not an empty instance: pre-1.9.383 engines
57
+ # false-validate empty instances (leptris#1859) — this keeps
58
+ # the spec meaningful across both engine generations
59
+ rows = schema.structured_errors("<note><from>x</from></note>")
60
+ skip "binding predates the structured report" if rows.nil?
61
+ expect(rows).not_to be_empty
62
+ expect(rows.first).to respond_to(:kind)
63
+ expect(rows.first).to respond_to(:component)
64
+ end
65
+ end
66
+ end
@@ -89,10 +89,18 @@ module ModelCoverage
89
89
  section: "Validation",
90
90
  pin: "spec/moxml/xsd_version_spec.rb",
91
91
  },
92
+ "validation engine metadata" => {
93
+ section: "Validation",
94
+ pin: "spec/moxml/xsd_engine_meta_spec.rb",
95
+ },
92
96
  "validation regex dismissal" => {
93
97
  section: "Validation",
94
98
  pin: "spec/moxml/xsd_regex_spec.rb",
95
99
  },
100
+ "validation builtin lexical table" => {
101
+ section: "Validation",
102
+ pin: "spec/moxml/xsd_builtin_lexical_spec.rb",
103
+ },
96
104
  "validation substitution dismissal" => {
97
105
  section: "Validation",
98
106
  pin: "spec/moxml/xsd_substitution_spec.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.166
4
+ version: 0.5.168
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-26 00:00:00.000000000 Z
11
+ date: 2026-10-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Moxml is a unified XML manipulation library that provides a common API
@@ -318,6 +318,7 @@ files:
318
318
  - lib/moxml/xpath/ruby/generator.rb
319
319
  - lib/moxml/xpath/ruby/node.rb
320
320
  - lib/moxml/xsd.rb
321
+ - lib/moxml/xsd/builtin_lexical.rb
321
322
  - lib/moxml/xsd/schema_rules.rb
322
323
  - lib/moxml/xslt.rb
323
324
  - lib/moxml/xslt/stylesheet.rb
@@ -486,11 +487,13 @@ files:
486
487
  - spec/moxml/adapter/leptris_binding_cap_spec.rb
487
488
  - spec/moxml/adapter/leptris_children_columnar_spec.rb
488
489
  - spec/moxml/adapter/leptris_contract_reads_spec.rb
490
+ - spec/moxml/adapter/leptris_crossdoc_replace_spec.rb
489
491
  - spec/moxml/adapter/leptris_detached_text_spec.rb
490
492
  - spec/moxml/adapter/leptris_doc_parts_spec.rb
491
493
  - spec/moxml/adapter/leptris_document_children_older_binding_spec.rb
492
494
  - spec/moxml/adapter/leptris_document_declaration_spec.rb
493
495
  - spec/moxml/adapter/leptris_inbody_comment_spec.rb
496
+ - spec/moxml/adapter/leptris_native_parent_axis_spec.rb
494
497
  - spec/moxml/adapter/leptris_parse_lint_spec.rb
495
498
  - spec/moxml/adapter/leptris_parse_skips_spec.rb
496
499
  - spec/moxml/adapter/leptris_record_driver_spec.rb
@@ -629,6 +632,8 @@ files:
629
632
  - spec/moxml/xpath/union_spec.rb
630
633
  - spec/moxml/xpath_capabilities_spec.rb
631
634
  - spec/moxml/xpath_spec.rb
635
+ - spec/moxml/xsd_builtin_lexical_spec.rb
636
+ - spec/moxml/xsd_engine_meta_spec.rb
632
637
  - spec/moxml/xsd_error_contract_spec.rb
633
638
  - spec/moxml/xsd_handle_mismatch_spec.rb
634
639
  - spec/moxml/xsd_regex_spec.rb