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: a49c2cdf5702fe7400d2cc4439632340cf8abe4ed214219d9d53a3bbacff6943
4
- data.tar.gz: 887431c911fa16aff6372c9c7c7addb034d0722f1ba11b0dfd28fb71bb4fb982
3
+ metadata.gz: cb4de517a8e23bcf76c55a9e1e935f5be2b096fca9c4075d309c7ef748c7b238
4
+ data.tar.gz: bb62186c0b7261db5b6cf1574280d21b70ee4a562c9bdc6f542c636fe96e2763
5
5
  SHA512:
6
- metadata.gz: f9c79f442e8be909743b4ecd1eaca9537d61be0d5925336507aa1869907c6795d68aac1a66b67c3fb2cedc0dab86bcab798b7850c3c41d7393a1f9301b862104
7
- data.tar.gz: d03289efc62a1b6c3cd9c66b6114879a3e68dc05883f20aab395264c2db7c7f0487da4baf2cce95d40493485f238e914b9acb88d974b7638e54efca43f678a30
6
+ metadata.gz: b26603400d059d7a60691c83b7a1f0ba54654e9c5d0dc21d7f851fc16b641bfe58de45859a4c9050a37ba6e4b69d1ab202ca41c8cda9910f93d8451d22b8bfdf
7
+ data.tar.gz: 12e9f4eb81abe1dcce11bae28bbb538c66886743882b66c528dc215868ac7e54b6d4ea09dc0a1ffe6b5945352929a6cc16677f4412fad315be9b207b5f3044fe
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Model
5
- VERSION = "0.8.110"
5
+ VERSION = "0.8.111"
6
6
  end
7
7
  end
@@ -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 = Moxml.new.parse(fragment_string, fragment: true)
82
- add_fragment_children_to_parent(fragment_doc, parent)
83
- rescue Moxml::ParseError
84
- # Engines without a fragment mode (leptris today, lutaml/moxml#188)
85
- # reject multiple top-level nodes; re-parse under a synthetic root
86
- # and lift its children.
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
  )
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.110
4
+ version: 0.8.111
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.