lutaml-model 0.8.191 → 0.8.192
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/lib/compat/opal/generate_boot.rb +5 -4
- data/lib/compat/opal/lutaml_model_boot.rb +0 -7
- data/lib/lutaml/model/serialize/format_conversion.rb +4 -6
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/xml/adapter/adapter_helpers.rb +3 -3
- data/lib/lutaml/xml/adapter/base_adapter.rb +13 -29
- data/lib/lutaml/xml/adapter/moxml_adapter.rb +113 -22
- data/lib/lutaml/xml/adapter/xml_parser.rb +6 -8
- data/lib/lutaml/xml/adapter/xml_serializer.rb +3 -1
- data/lib/lutaml/xml/adapter.rb +0 -4
- data/lib/lutaml/xml/adapter_element.rb +19 -9
- data/lib/lutaml/xml/adapter_loader.rb +26 -11
- data/lib/lutaml/xml/builder/base.rb +6 -7
- data/lib/lutaml/xml/document.rb +1 -1
- data/lib/lutaml/xml/format.rb +0 -10
- data/lib/lutaml/xml/leptris/plan_hydrator.rb +2 -2
- data/spec/lutaml/model/cdata_spec.rb +11 -27
- data/spec/lutaml/model/encoding_spec.rb +6 -6
- data/spec/lutaml/model/except_spec.rb +5 -7
- data/spec/lutaml/model/mixed_content_spec.rb +22 -25
- data/spec/lutaml/model/multiple_mapping_spec.rb +8 -10
- data/spec/lutaml/model/ordered_content_spec.rb +5 -8
- data/spec/lutaml/model/processing_instruction_spec.rb +6 -9
- data/spec/lutaml/model/serialize/attribute_definition_block_form_spec.rb +1 -1
- data/spec/lutaml/model/serialize/builder_spec.rb +1 -1
- data/spec/lutaml/xml/adapter/base_adapter_regression_spec.rb +5 -8
- data/spec/lutaml/xml/adapter/empty_document_diagnostics_spec.rb +3 -4
- data/spec/lutaml/xml/adapter/nokogiri_adapter_spec.rb +2 -2
- data/spec/lutaml/xml/adapter/oga_adapter_spec.rb +2 -2
- data/spec/lutaml/xml/adapter/order_spec.rb +8 -22
- data/spec/lutaml/xml/adapter/over_cap_parse_spec.rb +2 -2
- data/spec/lutaml/xml/adapter/ox_adapter_spec.rb +2 -2
- data/spec/lutaml/xml/adapter/rexml_adapter_spec.rb +2 -2
- data/spec/lutaml/xml/adapter/xml_namespace_spec.rb +5 -8
- data/spec/lutaml/xml/adapter_loader_spec.rb +15 -3
- data/spec/lutaml/xml/adapter_metadata_default_spec.rb +1 -1
- data/spec/lutaml/xml/adapter_moxml_engine_spec.rb +1 -2
- data/spec/lutaml/xml/builder/builder_spec.rb +28 -20
- data/spec/lutaml/xml/default_namespace_spec.rb +4 -5
- data/spec/lutaml/xml/entity_fragmentation_spec.rb +2 -2
- data/spec/lutaml/xml/mapping_rule_spec.rb +1 -2
- data/spec/lutaml/xml/mapping_spec.rb +12 -14
- data/spec/lutaml/xml/namespace_missing_prefix_spec.rb +1 -1
- data/spec/lutaml/xml/namespace_preservation_spec.rb +11 -11
- data/spec/lutaml/xml/namespace_scope_vcard_spec.rb +5 -8
- data/spec/lutaml/xml/prefix_control_spec.rb +5 -8
- data/spec/lutaml/xml/type_namespace_prefix_spec.rb +2 -2
- data/spec/lutaml/xml/xml_adapter_spec.rb +5 -8
- data/spec/lutaml/xml/xml_declaration_spec.rb +19 -19
- data/spec/spec_helper.rb +2 -2
- data/spec/support/test_adapter_config.rb +9 -25
- metadata +1 -21
- data/lib/lutaml/xml/adapter/leptris_adapter.rb +0 -16
- data/lib/lutaml/xml/adapter/nokogiri_adapter.rb +0 -16
- data/lib/lutaml/xml/adapter/oga_adapter.rb +0 -20
- data/lib/lutaml/xml/adapter/ox_adapter.rb +0 -16
- data/lib/lutaml/xml/adapter/rexml_adapter.rb +0 -25
- data/lib/lutaml/xml/builder/leptris.rb +0 -13
- data/lib/lutaml/xml/builder/nokogiri.rb +0 -13
- data/lib/lutaml/xml/builder/oga.rb +0 -13
- data/lib/lutaml/xml/builder/ox.rb +0 -13
- data/lib/lutaml/xml/builder/rexml.rb +0 -13
- data/lib/lutaml/xml/leptris/element.rb +0 -34
- data/lib/lutaml/xml/nokogiri/element.rb +0 -34
- data/lib/lutaml/xml/nokogiri.rb +0 -10
- data/lib/lutaml/xml/oga/element.rb +0 -15
- data/lib/lutaml/xml/oga.rb +0 -10
- data/lib/lutaml/xml/ox/element.rb +0 -15
- data/lib/lutaml/xml/ox.rb +0 -10
- data/lib/lutaml/xml/rexml/element.rb +0 -15
- data/lib/lutaml/xml/rexml.rb +0 -10
- data/lib/tasks/xml_optimization_benchmark.rb +0 -178
|
@@ -46,7 +46,7 @@ RSpec.describe "Type Namespace Prefix Issue #6" do
|
|
|
46
46
|
XML
|
|
47
47
|
|
|
48
48
|
# Parse
|
|
49
|
-
doc = Lutaml::Xml::Adapter::
|
|
49
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_input)
|
|
50
50
|
|
|
51
51
|
# Re-serialize
|
|
52
52
|
output = doc.to_xml
|
|
@@ -153,7 +153,7 @@ RSpec.describe "Type Namespace Prefix Issue #6" do
|
|
|
153
153
|
</article>
|
|
154
154
|
XML
|
|
155
155
|
|
|
156
|
-
doc = Lutaml::Xml::Adapter::
|
|
156
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_input)
|
|
157
157
|
output = doc.to_xml
|
|
158
158
|
|
|
159
159
|
# Verify all MathML elements retain their prefix
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
require "spec_helper"
|
|
2
|
-
require "lutaml/xml/adapter/
|
|
3
|
-
require "lutaml/xml/adapter/ox_adapter"
|
|
4
|
-
require "lutaml/xml/adapter/oga_adapter"
|
|
5
|
-
require "lutaml/xml/adapter/rexml_adapter"
|
|
2
|
+
require "lutaml/xml/adapter/moxml_adapter"
|
|
6
3
|
require_relative "../../fixtures/sample_model"
|
|
7
4
|
|
|
8
5
|
module XmlAdapterSpec
|
|
@@ -230,25 +227,25 @@ RSpec.describe "XmlAdapter" do
|
|
|
230
227
|
end
|
|
231
228
|
end
|
|
232
229
|
|
|
233
|
-
describe Lutaml::Xml::Adapter::
|
|
230
|
+
describe Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri) do
|
|
234
231
|
it_behaves_like "an XML adapter", described_class
|
|
235
232
|
end
|
|
236
233
|
|
|
237
|
-
describe Lutaml::Xml::Adapter::
|
|
234
|
+
describe Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:ox) do
|
|
238
235
|
if TestAdapterConfig.adapter_enabled?(:ox)
|
|
239
236
|
it_behaves_like "an XML adapter",
|
|
240
237
|
described_class
|
|
241
238
|
end
|
|
242
239
|
end
|
|
243
240
|
|
|
244
|
-
describe Lutaml::Xml::Adapter::
|
|
241
|
+
describe Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:oga) do
|
|
245
242
|
if TestAdapterConfig.adapter_enabled?(:oga)
|
|
246
243
|
it_behaves_like "an XML adapter",
|
|
247
244
|
described_class
|
|
248
245
|
end
|
|
249
246
|
end
|
|
250
247
|
|
|
251
|
-
describe Lutaml::Xml::Adapter::
|
|
248
|
+
describe Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:rexml) do
|
|
252
249
|
if TestAdapterConfig.adapter_enabled?(:rexml)
|
|
253
250
|
it_behaves_like "an XML adapter",
|
|
254
251
|
described_class
|
|
@@ -30,7 +30,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
30
30
|
</simple>
|
|
31
31
|
XML
|
|
32
32
|
|
|
33
|
-
doc = Lutaml::Xml::Adapter::
|
|
33
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
34
34
|
expect(doc.xml_declaration).not_to be_nil
|
|
35
35
|
expect(doc.xml_declaration[:had_declaration]).to be true
|
|
36
36
|
expect(doc.xml_declaration[:version]).to eq("1.0")
|
|
@@ -46,7 +46,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
46
46
|
</simple>
|
|
47
47
|
XML
|
|
48
48
|
|
|
49
|
-
doc = Lutaml::Xml::Adapter::
|
|
49
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
50
50
|
expect(doc.xml_declaration[:version]).to eq("1.1")
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -59,7 +59,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
59
59
|
</simple>
|
|
60
60
|
XML
|
|
61
61
|
|
|
62
|
-
doc = Lutaml::Xml::Adapter::
|
|
62
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
63
63
|
expect(doc.xml_declaration[:had_declaration]).to be true
|
|
64
64
|
expect(doc.xml_declaration[:version]).to eq("1.0")
|
|
65
65
|
expect(doc.xml_declaration[:encoding]).to be_nil
|
|
@@ -74,7 +74,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
74
74
|
</simple>
|
|
75
75
|
XML
|
|
76
76
|
|
|
77
|
-
doc = Lutaml::Xml::Adapter::
|
|
77
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
78
78
|
expect(doc.xml_declaration[:encoding]).to eq("ISO-8859-1")
|
|
79
79
|
end
|
|
80
80
|
|
|
@@ -86,7 +86,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
86
86
|
</simple>
|
|
87
87
|
XML
|
|
88
88
|
|
|
89
|
-
doc = Lutaml::Xml::Adapter::
|
|
89
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
90
90
|
expect(doc.xml_declaration).not_to be_nil
|
|
91
91
|
expect(doc.xml_declaration[:had_declaration]).to be false
|
|
92
92
|
end
|
|
@@ -94,7 +94,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
94
94
|
it "handles declaration with whitespace" do
|
|
95
95
|
xml = " \n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<simple><name>Test</name><value>42</value></simple>"
|
|
96
96
|
|
|
97
|
-
doc = Lutaml::Xml::Adapter::
|
|
97
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
98
98
|
expect(doc.xml_declaration[:had_declaration]).to be true
|
|
99
99
|
end
|
|
100
100
|
end
|
|
@@ -110,7 +110,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
110
110
|
</simple>
|
|
111
111
|
XML
|
|
112
112
|
|
|
113
|
-
doc = Lutaml::Xml::Adapter::
|
|
113
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
114
114
|
xml_out = doc.to_xml
|
|
115
115
|
|
|
116
116
|
expect(xml_out).to start_with("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
|
|
@@ -155,7 +155,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
155
155
|
</simple>
|
|
156
156
|
XML
|
|
157
157
|
|
|
158
|
-
doc = Lutaml::Xml::Adapter::
|
|
158
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
159
159
|
xml_out = doc.to_xml
|
|
160
160
|
|
|
161
161
|
expect(xml_out).to include("encoding=\"ISO-8859-1\"")
|
|
@@ -170,7 +170,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
170
170
|
</simple>
|
|
171
171
|
XML
|
|
172
172
|
|
|
173
|
-
doc = Lutaml::Xml::Adapter::
|
|
173
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
174
174
|
xml_out = doc.to_xml
|
|
175
175
|
|
|
176
176
|
expect(xml_out).to start_with("<?xml version=\"1.0\"?>")
|
|
@@ -186,7 +186,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
186
186
|
</simple>
|
|
187
187
|
XML
|
|
188
188
|
|
|
189
|
-
doc = Lutaml::Xml::Adapter::
|
|
189
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
190
190
|
xml_out = doc.to_xml
|
|
191
191
|
|
|
192
192
|
expect(xml_out).to include('standalone="yes"')
|
|
@@ -201,7 +201,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
201
201
|
</simple>
|
|
202
202
|
XML
|
|
203
203
|
|
|
204
|
-
doc = Lutaml::Xml::Adapter::
|
|
204
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
205
205
|
xml_out = doc.to_xml
|
|
206
206
|
|
|
207
207
|
expect(xml_out).to include('standalone="no"')
|
|
@@ -232,7 +232,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
232
232
|
</simple>
|
|
233
233
|
XML
|
|
234
234
|
|
|
235
|
-
doc = Lutaml::Xml::Adapter::
|
|
235
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
236
236
|
xml_out = doc.to_xml
|
|
237
237
|
|
|
238
238
|
expect(xml_out).not_to start_with("<?xml")
|
|
@@ -371,7 +371,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
371
371
|
</simple>
|
|
372
372
|
XML
|
|
373
373
|
|
|
374
|
-
doc = Lutaml::Xml::Adapter::
|
|
374
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
375
375
|
xml_out = doc.to_xml
|
|
376
376
|
|
|
377
377
|
expect(xml_out).to include("encoding=\"Shift_JIS\"")
|
|
@@ -380,7 +380,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
380
380
|
it "omits encoding attribute when none specified" do
|
|
381
381
|
xml_in = "<?xml version=\"1.0\"?><simple><name>Test</name><value>42</value></simple>"
|
|
382
382
|
|
|
383
|
-
doc = Lutaml::Xml::Adapter::
|
|
383
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
384
384
|
xml_out = doc.to_xml
|
|
385
385
|
|
|
386
386
|
expect(xml_out).to start_with("<?xml version=\"1.0\"?>")
|
|
@@ -443,7 +443,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
443
443
|
it "omits standalone when :preserve and input had none" do
|
|
444
444
|
xml_in = "<?xml version=\"1.0\"?><simple><name>Test</name><value>42</value></simple>"
|
|
445
445
|
|
|
446
|
-
doc = Lutaml::Xml::Adapter::
|
|
446
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml_in)
|
|
447
447
|
xml_out = doc.to_xml(standalone: :preserve)
|
|
448
448
|
|
|
449
449
|
expect(xml_out).not_to include("standalone=")
|
|
@@ -496,7 +496,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
496
496
|
it "handles declaration with single quotes" do
|
|
497
497
|
xml = "<?xml version='1.0' encoding='UTF-8'?><simple><name>Test</name><value>42</value></simple>"
|
|
498
498
|
|
|
499
|
-
doc = Lutaml::Xml::Adapter::
|
|
499
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
500
500
|
expect(doc.xml_declaration[:had_declaration]).to be true
|
|
501
501
|
expect(doc.xml_declaration[:version]).to eq("1.0")
|
|
502
502
|
expect(doc.xml_declaration[:encoding]).to eq("UTF-8")
|
|
@@ -505,14 +505,14 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
505
505
|
it "handles declaration with extra whitespace" do
|
|
506
506
|
xml = "<?xml version = \"1.0\" encoding = \"UTF-8\" ?><simple><name>Test</name><value>42</value></simple>"
|
|
507
507
|
|
|
508
|
-
doc = Lutaml::Xml::Adapter::
|
|
508
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
509
509
|
expect(doc.xml_declaration[:had_declaration]).to be true
|
|
510
510
|
end
|
|
511
511
|
|
|
512
512
|
it "handles standalone attribute in declaration" do
|
|
513
513
|
xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><simple><name>Test</name><value>42</value></simple>"
|
|
514
514
|
|
|
515
|
-
doc = Lutaml::Xml::Adapter::
|
|
515
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
516
516
|
expect(doc.xml_declaration[:had_declaration]).to be true
|
|
517
517
|
expect(doc.xml_declaration[:version]).to eq("1.0")
|
|
518
518
|
expect(doc.xml_declaration[:encoding]).to eq("UTF-8")
|
|
@@ -522,7 +522,7 @@ RSpec.describe "XML Declaration Preservation" do
|
|
|
522
522
|
it "detects standalone=no attribute" do
|
|
523
523
|
xml = "<?xml version=\"1.0\" standalone=\"no\"?><simple><name>Test</name><value>42</value></simple>"
|
|
524
524
|
|
|
525
|
-
doc = Lutaml::Xml::Adapter::
|
|
525
|
+
doc = Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(:nokogiri).parse(xml)
|
|
526
526
|
expect(doc.xml_declaration[:standalone]).to eq("no")
|
|
527
527
|
end
|
|
528
528
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -109,8 +109,8 @@ require "lutaml/model"
|
|
|
109
109
|
require "lutaml/xml"
|
|
110
110
|
require_relative "support/test_namespaces"
|
|
111
111
|
require_relative "support/test_adapter_config"
|
|
112
|
-
#
|
|
113
|
-
#
|
|
112
|
+
# require "lutaml/xml/adapter/moxml_adapter"
|
|
113
|
+
# require "lutaml/xml/adapter/moxml_adapter"
|
|
114
114
|
# require_relative "../lib/lutaml/model/toml_adapter/toml_rb_adapter"
|
|
115
115
|
|
|
116
116
|
Lutaml::Model::Config.configure do |config|
|
|
@@ -54,20 +54,12 @@ class TestAdapterConfig
|
|
|
54
54
|
adapters_to_test.include?(name)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
# Get adapter
|
|
58
|
-
#
|
|
59
|
-
# @
|
|
57
|
+
# Get the adapter lane for an engine: the one moxml adapter
|
|
58
|
+
# pinned to that engine.
|
|
59
|
+
# @param name [Symbol] Engine name (:nokogiri, :ox, :oga, :rexml, :leptris)
|
|
60
|
+
# @return [Class] The pinned adapter class
|
|
60
61
|
def adapter_class(name)
|
|
61
|
-
|
|
62
|
-
when :nokogiri
|
|
63
|
-
Lutaml::Xml::Adapter::NokogiriAdapter
|
|
64
|
-
when :ox
|
|
65
|
-
defined?(Lutaml::Xml::Adapter::OxAdapter) ? Lutaml::Xml::Adapter::OxAdapter : nil
|
|
66
|
-
when :oga
|
|
67
|
-
defined?(Lutaml::Xml::Adapter::OgaAdapter) ? Lutaml::Xml::Adapter::OgaAdapter : nil
|
|
68
|
-
when :rexml
|
|
69
|
-
defined?(Lutaml::Xml::Adapter::RexmlAdapter) ? Lutaml::Xml::Adapter::RexmlAdapter : nil
|
|
70
|
-
end
|
|
62
|
+
Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(name)
|
|
71
63
|
end
|
|
72
64
|
|
|
73
65
|
# Get list of all available adapter names
|
|
@@ -76,20 +68,12 @@ class TestAdapterConfig
|
|
|
76
68
|
%i[nokogiri ox oga rexml]
|
|
77
69
|
end
|
|
78
70
|
|
|
79
|
-
# Get
|
|
71
|
+
# Get engine name by adapter class
|
|
80
72
|
# @param klass [Class] Adapter class
|
|
81
|
-
# @return [Symbol, nil]
|
|
73
|
+
# @return [Symbol, nil] Engine name or nil if not the moxml adapter family
|
|
82
74
|
def adapter_name(klass)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
:nokogiri
|
|
86
|
-
when Lutaml::Xml::Adapter::OxAdapter
|
|
87
|
-
:ox
|
|
88
|
-
when Lutaml::Xml::Adapter::OgaAdapter
|
|
89
|
-
:oga
|
|
90
|
-
when defined?(Lutaml::Xml::Adapter::RexmlAdapter) && Lutaml::Xml::Adapter::RexmlAdapter
|
|
91
|
-
:rexml
|
|
92
|
-
end
|
|
75
|
+
klass.engine_name if klass.is_a?(Class) &&
|
|
76
|
+
klass <= Lutaml::Xml::Adapter::MoxmlAdapter
|
|
93
77
|
end
|
|
94
78
|
end
|
|
95
79
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.192
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -877,15 +877,10 @@ files:
|
|
|
877
877
|
- lib/lutaml/xml/adapter.rb
|
|
878
878
|
- lib/lutaml/xml/adapter/adapter_helpers.rb
|
|
879
879
|
- lib/lutaml/xml/adapter/base_adapter.rb
|
|
880
|
-
- lib/lutaml/xml/adapter/leptris_adapter.rb
|
|
881
880
|
- lib/lutaml/xml/adapter/moxml_adapter.rb
|
|
882
881
|
- lib/lutaml/xml/adapter/namespace_data.rb
|
|
883
882
|
- lib/lutaml/xml/adapter/namespace_uri_collector.rb
|
|
884
|
-
- lib/lutaml/xml/adapter/nokogiri_adapter.rb
|
|
885
|
-
- lib/lutaml/xml/adapter/oga_adapter.rb
|
|
886
|
-
- lib/lutaml/xml/adapter/ox_adapter.rb
|
|
887
883
|
- lib/lutaml/xml/adapter/plan_based_builder.rb
|
|
888
|
-
- lib/lutaml/xml/adapter/rexml_adapter.rb
|
|
889
884
|
- lib/lutaml/xml/adapter/xml_parser.rb
|
|
890
885
|
- lib/lutaml/xml/adapter/xml_serializer.rb
|
|
891
886
|
- lib/lutaml/xml/adapter_element.rb
|
|
@@ -895,11 +890,6 @@ files:
|
|
|
895
890
|
- lib/lutaml/xml/blank_namespace_handler.rb
|
|
896
891
|
- lib/lutaml/xml/builder.rb
|
|
897
892
|
- lib/lutaml/xml/builder/base.rb
|
|
898
|
-
- lib/lutaml/xml/builder/leptris.rb
|
|
899
|
-
- lib/lutaml/xml/builder/nokogiri.rb
|
|
900
|
-
- lib/lutaml/xml/builder/oga.rb
|
|
901
|
-
- lib/lutaml/xml/builder/ox.rb
|
|
902
|
-
- lib/lutaml/xml/builder/rexml.rb
|
|
903
893
|
- lib/lutaml/xml/collection_consolidation.rb
|
|
904
894
|
- lib/lutaml/xml/configurable.rb
|
|
905
895
|
- lib/lutaml/xml/data_model.rb
|
|
@@ -946,7 +936,6 @@ files:
|
|
|
946
936
|
- lib/lutaml/xml/hoisting_algorithm.rb
|
|
947
937
|
- lib/lutaml/xml/html_entities.rb
|
|
948
938
|
- lib/lutaml/xml/leptris.rb
|
|
949
|
-
- lib/lutaml/xml/leptris/element.rb
|
|
950
939
|
- lib/lutaml/xml/leptris/native_emission.rb
|
|
951
940
|
- lib/lutaml/xml/leptris/plan_compiler.rb
|
|
952
941
|
- lib/lutaml/xml/leptris/plan_hydrator.rb
|
|
@@ -972,19 +961,11 @@ files:
|
|
|
972
961
|
- lib/lutaml/xml/namespace_type_resolver.rb
|
|
973
962
|
- lib/lutaml/xml/namespace_usage.rb
|
|
974
963
|
- lib/lutaml/xml/nested_collection_attribute.rb
|
|
975
|
-
- lib/lutaml/xml/nokogiri.rb
|
|
976
|
-
- lib/lutaml/xml/nokogiri/element.rb
|
|
977
|
-
- lib/lutaml/xml/oga.rb
|
|
978
|
-
- lib/lutaml/xml/oga/element.rb
|
|
979
|
-
- lib/lutaml/xml/ox.rb
|
|
980
|
-
- lib/lutaml/xml/ox/element.rb
|
|
981
964
|
- lib/lutaml/xml/parse_session.rb
|
|
982
965
|
- lib/lutaml/xml/parsed_namespace_declaration.rb
|
|
983
966
|
- lib/lutaml/xml/parsed_namespace_set.rb
|
|
984
967
|
- lib/lutaml/xml/polymorphic_value_handler.rb
|
|
985
968
|
- lib/lutaml/xml/qualified_inheritance_strategy.rb
|
|
986
|
-
- lib/lutaml/xml/rexml.rb
|
|
987
|
-
- lib/lutaml/xml/rexml/element.rb
|
|
988
969
|
- lib/lutaml/xml/schema.rb
|
|
989
970
|
- lib/lutaml/xml/schema/builder.rb
|
|
990
971
|
- lib/lutaml/xml/schema/builder/moxml.rb
|
|
@@ -1141,7 +1122,6 @@ files:
|
|
|
1141
1122
|
- lib/tasks/performance_probe_plan_walk.rb
|
|
1142
1123
|
- lib/tasks/performance_probe_xml.rb
|
|
1143
1124
|
- lib/tasks/xml_compiler_benchmark.rb
|
|
1144
|
-
- lib/tasks/xml_optimization_benchmark.rb
|
|
1145
1125
|
- lutaml-model.gemspec
|
|
1146
1126
|
- reference-docs/XML Entity Definitions for Characters (3rd Edition).html
|
|
1147
1127
|
- scripts-xmi-profile/profile_xmi.rb
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "moxml/adapter/leptris"
|
|
4
|
-
|
|
5
|
-
module Lutaml
|
|
6
|
-
module Xml
|
|
7
|
-
module Adapter
|
|
8
|
-
class LeptrisAdapter < BaseAdapter
|
|
9
|
-
MOXML_ADAPTER = Moxml::Adapter::Leptris
|
|
10
|
-
BUILDER_CLASS = Builder::Leptris
|
|
11
|
-
PARSED_ELEMENT_CLASS = Lutaml::Xml::LeptrisElement
|
|
12
|
-
PARSE_ERROR_CLASS = Moxml::ParseError
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "moxml"
|
|
4
|
-
require "moxml/adapter/nokogiri"
|
|
5
|
-
|
|
6
|
-
module Lutaml
|
|
7
|
-
module Xml
|
|
8
|
-
module Adapter
|
|
9
|
-
class NokogiriAdapter < BaseAdapter
|
|
10
|
-
MOXML_ADAPTER = Moxml::Adapter::Nokogiri
|
|
11
|
-
BUILDER_CLASS = Builder::Nokogiri
|
|
12
|
-
PARSED_ELEMENT_CLASS = Lutaml::Xml::NokogiriElement
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "oga"
|
|
4
|
-
require "moxml/adapter/oga"
|
|
5
|
-
|
|
6
|
-
module Lutaml
|
|
7
|
-
module Xml
|
|
8
|
-
module Adapter
|
|
9
|
-
# @deprecated the Oga engine is on the deprecation path — moxml's
|
|
10
|
-
# default engine (Nokogiri, or the leptris native engine when
|
|
11
|
-
# present) is the supported XML lane. Selection emits a
|
|
12
|
-
# deprecation warning; removal lands in a future release.
|
|
13
|
-
class OgaAdapter < BaseAdapter
|
|
14
|
-
MOXML_ADAPTER = Moxml::Adapter::Oga
|
|
15
|
-
BUILDER_CLASS = Builder::Oga
|
|
16
|
-
PARSED_ELEMENT_CLASS = Oga::Element
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "moxml/adapter/ox"
|
|
4
|
-
|
|
5
|
-
module Lutaml
|
|
6
|
-
module Xml
|
|
7
|
-
module Adapter
|
|
8
|
-
class OxAdapter < BaseAdapter
|
|
9
|
-
MOXML_ADAPTER = Moxml::Adapter::Ox
|
|
10
|
-
BUILDER_CLASS = Builder::Ox
|
|
11
|
-
PARSED_ELEMENT_CLASS = Ox::Element
|
|
12
|
-
PARSE_ERROR_CLASS = Moxml::ParseError
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "rexml/document"
|
|
4
|
-
require "moxml"
|
|
5
|
-
require "moxml/adapter/rexml"
|
|
6
|
-
|
|
7
|
-
module Lutaml
|
|
8
|
-
module Xml
|
|
9
|
-
module Adapter
|
|
10
|
-
# @deprecated the REXML engine is on the deprecation path — moxml's
|
|
11
|
-
# default engine (Nokogiri, or the leptris native engine when
|
|
12
|
-
# present) is the supported XML lane. Selection emits a
|
|
13
|
-
# deprecation warning; removal lands in a future release.
|
|
14
|
-
class RexmlAdapter < BaseAdapter
|
|
15
|
-
MOXML_ADAPTER = Moxml::Adapter::Rexml
|
|
16
|
-
BUILDER_CLASS = Builder::Rexml
|
|
17
|
-
PARSED_ELEMENT_CLASS = Rexml::Element
|
|
18
|
-
EMPTY_DOCUMENT_ERROR_MESSAGE = "Malformed XML: Unable to parse " \
|
|
19
|
-
"the provided XML document. The document structure is invalid " \
|
|
20
|
-
"or incomplete."
|
|
21
|
-
EMPTY_DOCUMENT_ERROR_TYPE = :parse_exception
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Lutaml
|
|
4
|
-
module Xml
|
|
5
|
-
class LeptrisElement < AdapterElement
|
|
6
|
-
def initialize(node, parent: nil, default_namespace: nil)
|
|
7
|
-
@raw_text = node.raw_content if node.is_a?(Moxml::Text)
|
|
8
|
-
super
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
def adapter_class
|
|
14
|
-
Lutaml::Xml::Adapter::LeptrisAdapter
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def build_text_for_xml
|
|
18
|
-
@raw_text || @text
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def build_element_xml(builder)
|
|
22
|
-
builder.create_and_add_element(name,
|
|
23
|
-
prefix: namespace_prefix,
|
|
24
|
-
attributes: build_attributes(self)) do |xml|
|
|
25
|
-
children.each { |child| child.build_xml(xml) }
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def attribute_value_for_build(attr)
|
|
30
|
-
attr.raw_value
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Lutaml
|
|
4
|
-
module Xml
|
|
5
|
-
class NokogiriElement < AdapterElement
|
|
6
|
-
def initialize(node, parent: nil, default_namespace: nil)
|
|
7
|
-
@raw_text = node.raw_content if node.is_a?(Moxml::Text)
|
|
8
|
-
super
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
def adapter_class
|
|
14
|
-
Lutaml::Xml::Adapter::NokogiriAdapter
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def build_text_for_xml
|
|
18
|
-
@raw_text || @text
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def build_element_xml(builder)
|
|
22
|
-
builder.create_and_add_element(name,
|
|
23
|
-
prefix: namespace_prefix,
|
|
24
|
-
attributes: build_attributes(self)) do |xml|
|
|
25
|
-
children.each { |child| child.build_xml(xml) }
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def attribute_value_for_build(attr)
|
|
30
|
-
attr.raw_value
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
data/lib/lutaml/xml/nokogiri.rb
DELETED
data/lib/lutaml/xml/oga.rb
DELETED