xmlData.attribute("Pro1"); // correct
But if i try the code:
xmlData.attribute("Pro2"); // Not null,and even not "", but i
really do not know what it is.It just shows blank in "Alert.show()"
In the fact, i want to check whether the XML Node has a
certain property.Finally i find the method "hasOwnProperty()", but
it does not seem to work like its name:
xmlData.hasOwnProperty("Pro1"); // return false
xmlData.hasOwnProperty("Pro2"); // return fasle
If you look at the return value of the attribute() method,
it's an XMLList. You can think of it as an array of XML objects. In
this case, it returned an empty XMLList. Just check whether
length() is 0 is not.