lib/xommelier/xml/element/serialization.rb in xommelier-0.1.9 vs lib/xommelier/xml/element/serialization.rb in xommelier-0.1.10
- old
+ new
@@ -58,10 +58,11 @@
end
alias_method :from_xommelier, :from_xml
def to_xml(options = {})
options = SERIALIZATION_OPTIONS.merge(options)
- element_name = options.delete(:element_name) { self.element_name }
+ element_name = options.delete(:element_name) { self.element_name }.to_s
+ element_name << '_' if %w(text class id).include?(element_name)
if options[:builder] # Non-root element
builder = options.delete(:builder)
attribute_values = {}
namespaces = builder.doc.namespaces
prefix = builder.doc.namespaces.key(xmlns.uri)[6..-1].presence