Naresh Ramaswamy
Usenet Archive
- Joined
- Dec 30, 2008
- Messages
- 13
- Reaction score
- 0
hi,
I am using REXML
I want to get all the attributes under an element. Just imagine that I know the element name but not the attribute names.
say <element att1="x" att2="y" att3="3"/> and so on as many attributes that can be.
I need to get all the attributes under the element. How shall I do it.
I looked into REXML doc that provides
"doc.root.attributes.each {|name, value| puts name+" => "+value }"
But I am able to use this only on root element, and does not work on child or subchild elements.
Please let me know how can I do that.
Regards,
Naresh
I am using REXML
I want to get all the attributes under an element. Just imagine that I know the element name but not the attribute names.
say <element att1="x" att2="y" att3="3"/> and so on as many attributes that can be.
I need to get all the attributes under the element. How shall I do it.
I looked into REXML doc that provides
"doc.root.attributes.each {|name, value| puts name+" => "+value }"
But I am able to use this only on root element, and does not work on child or subchild elements.
Please let me know how can I do that.
Regards,
Naresh