canon 0.3.0 → 0.3.1
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/canon/version.rb +1 -1
- data/lib/canon/xml/data_model.rb +5 -5
- 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: 8180c4d10ad157f5fd7d401d7c4723a70d53daa90894a43c33016253d0355093
|
|
4
|
+
data.tar.gz: 513538a92c8f209b2eeec7ecf2adedf9e2a86de8e2c6c0e807b45522afffa9b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15bbb37c41f2fe0809be3a1ae9e6e3bf438d7d509eb478b92eb1ace044d511017a257409024c0c7e042bf5dc146af0dbbfc9397c6ffea13a5d410fb9019c716d
|
|
7
|
+
data.tar.gz: 81c275d67d47bfeb87a1c5969e90643da41e8816e882a40fa5affa8337fbd3c5bd0ee82428ef63b36bc5dff8338776e8df4da53394d3319663f3167433664785
|
data/lib/canon/version.rb
CHANGED
data/lib/canon/xml/data_model.rb
CHANGED
|
@@ -261,7 +261,7 @@ preserve_whitespace: false)
|
|
|
261
261
|
# --- Moxml path ---
|
|
262
262
|
|
|
263
263
|
def self.from_moxml_xml(xml_string, preserve_whitespace:)
|
|
264
|
-
doc = Canon::XmlParsing.parse(xml_string)
|
|
264
|
+
doc = Canon::XmlParsing.moxml_context.parse(xml_string, readonly: true)
|
|
265
265
|
check_moxml_relative_namespace_uris(doc)
|
|
266
266
|
result = build_from_moxml(doc, preserve_whitespace: preserve_whitespace)
|
|
267
267
|
# Canon owns this document's full lifecycle: the canon tree holds
|
|
@@ -390,11 +390,11 @@ preserve_whitespace: false)
|
|
|
390
390
|
))
|
|
391
391
|
end
|
|
392
392
|
|
|
393
|
-
# Adopt completed children
|
|
394
|
-
#
|
|
393
|
+
# Adopt completed children: they pop in reverse order; reversing
|
|
394
|
+
# once is O(n) (unshift per child would be O(n^2) on wide trees).
|
|
395
395
|
children = []
|
|
396
|
-
children
|
|
397
|
-
children.
|
|
396
|
+
children << frames.pop[1] while frames.any? && frames.last[0] > record[:depth]
|
|
397
|
+
children.reverse_each { |child| element.add_child(child) }
|
|
398
398
|
|
|
399
399
|
own_namespaces[element] = record[:namespaces]
|
|
400
400
|
element
|