Question: How to handle attributes?
EricForgy opened this issue Β· comments
Hi π
Very cool package π
I'm struggling a little bit with eachattribute
. I was trying to construct a Dict
from node attributes, but I am doing something wrong. I tried:
element = parsexml("""<Test attr1="1" attr2="2"/>""").root
d = Dict{String,Any}()
for attr in eachattribute(element)
d[attr.name] = attr.value
end
ERROR: type Node has no field value
What is the correct way to do this?
Thank you π
Got it π
Instead of attr.value
, it should be attr.content
π