Closed jrz closed 10 years ago
Very strange! I'll take a look at what is going on with this.
I took a look at this, and I think you're perhaps expecting to receive a Nokogiri::XML::Element
but what actually comes back is a Nokogiri::XML::Document
. You can access the attributes via:
parser.for_tag(:product).each do |offer|
puts offer.elements.first.attributes['id'].value
end
When saxing using xml, the attributes of the current root element is not accessible, even though it prints using element.to_s:
Doesn't work. but:
does.
xml: