I'm pulling a bunch of data from one database and feeding it into an application via XML.
So I start with
re_objects_xml = Document.new
re_objects_xml.context[:attribute_quote] = :quote
re_objects_xml.context[:raw] = 'true'
re_objects_xml.add_element("object-collection")
base_object_collection = re_objects_xml.elements[1]
timeline_meta = Element.new("Metadata")
timeline_meta.add_attribute("id", "#{re_meta_id}")
an then I have the following variables:
k = "Comments"
v = "We're pretty good"
and I do
timeline_meta.add_attribute("#{k}","#{v}")
And then add timeline_meta to base_object_collection
base_object_collection << timeline_meta
I end up with XML that contains this:
...Comments="GRUBB: We're pretty good...
I'm trying to get
...Comments="GRUBB: We're pretty good...
Can anyone help me see what I'm missing or a better way to do this?