lib/xommelier/xml/element/serialization.rb in xommelier-0.1.26 vs lib/xommelier/xml/element/serialization.rb in xommelier-0.1.27
- old
+ new
@@ -258,11 +258,11 @@
serialize_element(name, item, xml, element)
end
end
else
xmlns = element.overridden_xmlns || self.xmlns
- prefix = if xmlns != element.ns
- xml.doc.namespaces.key(element.ns.uri)[6..-1].presence
+ prefix = if xmlns != xml.doc.namespaces['xmlns']
+ xml.doc.namespaces.key(element.ns.uri).try(:[], 6..-1).presence
end
case value
when Xommelier::Xml::Element
value.to_xommelier(
builder: xml,