lib/lutaml/model/xml_adapter/nokogiri_adapter.rb in lutaml-model-0.3.2 vs lib/lutaml/model/xml_adapter/nokogiri_adapter.rb in lutaml-model-0.3.3
- old
+ new
@@ -46,11 +46,12 @@
xml[xml_mapping.namespace_prefix]
else
xml
end
- prefixed_xml.public_send(xml_mapping.root_element, attributes) do
+ tag_name = options[:tag_name] || xml_mapping.root_element
+ prefixed_xml.public_send(tag_name, attributes) do
if options.key?(:namespace_prefix) && !options[:namespace_prefix]
xml.parent.namespace = nil
end
xml_mapping.elements.each do |element_rule|
@@ -92,10 +93,11 @@
xml[xml_mapping.namespace_prefix]
else
xml
end
- prefixed_xml.public_send(xml_mapping.root_element, attributes) do
+ tag_name = options[:tag_name] || xml_mapping.root_element
+ prefixed_xml.public_send(tag_name, attributes) do
if options.key?(:namespace_prefix) && !options[:namespace_prefix]
xml.parent.namespace = nil
end
index_hash = {}