Having a heck of a time with this one.
I have a node that looks like this:
<ItemInfo>
<ProductVar text_id="Variable1">MyValue</ProductVar>
<ProductVar text_id="Variable2">MySecondValue</ProductVar>
</ItemInfo>
I need both the value of the attribute "text_id" and the element value
"MyValue". I was trying to use something like what I saw in the
"current weather" example:
<aws:current-condition icon="
http://deskwx.weatherbug.com/images/
Forecast/icons/cond007.gif">Sunny</aws:current-condition>
element :current_condition, String, :tag => 'current-
condition', :attributes => {:icon => String}
Which (the example) works just fine on my system. So this is the
mapping I have:
class ItemInfo
include HappyMapper
tag 'ItemInfo'
has_many :product_var, String, :tag => "ProductVar", :attributes =>
{:text_id => String}
end
This does not return text_id. I can return
item_info.product_var.text_id if I use "element" in place of
"has_many", but there are always going to be multiple "ProductVar"s,
so that won't work. Whenever I try to replace "element" with
"has_many", I get this error:
undefined method `attribute_nodes' for ["text_id", "Variable1"]:Array
Ideas?