Copy link to clipboard
Copied
Is there a way to retrieve all the attributes names of a XML element?
Say i have this xml:
var fruit= <Banana weight="158.3kg" length="2.03m" origin="Kepler-186f"/>;
fruit.children() and fruit.elements() do not list attributes.
fruit.attributes() only lists the values, not their names.
I would like to retrieve the attributes names, ie "weight", "length", "origin".
It's possible by parsing fruit.toXMLString(), but.. i'd rather not do that(!)
Any suggestion ?
Xavier
Have something to add?