lutaml-model 0.8.110 → 0.8.111
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb4de517a8e23bcf76c55a9e1e935f5be2b096fca9c4075d309c7ef748c7b238
|
|
4
|
+
data.tar.gz: bb62186c0b7261db5b6cf1574280d21b70ee4a562c9bdc6f542c636fe96e2763
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b26603400d059d7a60691c83b7a1f0ba54654e9c5d0dc21d7f851fc16b641bfe58de45859a4c9050a37ba6e4b69d1ab202ca41c8cda9910f93d8451d22b8bfdf
|
|
7
|
+
data.tar.gz: 12e9f4eb81abe1dcce11bae28bbb538c66886743882b66c528dc215868ac7e54b6d4ea09dc0a1ffe6b5945352929a6cc16677f4412fad315be9b207b5f3044fe
|
data/lib/lutaml/model/version.rb
CHANGED
|
@@ -78,12 +78,21 @@ module Lutaml
|
|
|
78
78
|
|
|
79
79
|
def add_xml_fragment_or_raw_content(parent, fragment_string)
|
|
80
80
|
require "moxml" unless defined?(Moxml)
|
|
81
|
-
fragment_doc =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
fragment_doc = begin
|
|
82
|
+
Moxml.new.parse(fragment_string, fragment: true)
|
|
83
|
+
rescue Moxml::ParseError
|
|
84
|
+
# Engines that reject multi-root fragments outright
|
|
85
|
+
# (lutaml/moxml#188) — fall through to the synthetic root.
|
|
86
|
+
nil
|
|
87
|
+
end
|
|
88
|
+
# The fallback keys on the RESULT, not the exception: recover-mode
|
|
89
|
+
# engines return an empty document for multi-root fragments instead
|
|
90
|
+
# of raising, which used to leave the synthetic-root path dead and
|
|
91
|
+
# the fragment silently dropped.
|
|
92
|
+
if fragment_doc&.children&.any?(&:element?)
|
|
93
|
+
return add_fragment_children_to_parent(fragment_doc, parent)
|
|
94
|
+
end
|
|
95
|
+
|
|
87
96
|
wrapped = Moxml.new.parse(
|
|
88
97
|
"<lutaml-fragment>#{fragment_string}</lutaml-fragment>",
|
|
89
98
|
)
|