2 Replies Latest reply on Jul 23, 2006 6:39 PM by isml

    I met problems about XML Node attributes in Flex 2.0

    isml Level 1
      Here is my example

      <Root Pro1="1">
      <TestNode />
      </Root>

      I get the XML from HTTPService:

      var xmlData:XML = new XML(hsTest.lastResult);

      I can get the value by the method "attribute()":

      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()" method.

      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

      I wonder how i should code it.

      Thanks in advance.