Test existence of xml attribute in as3

Posted by matb on Stack Overflow See other posts from Stack Overflow or by matb
Published on 2011-01-13T01:52:24Z Indexed on 2011/01/13 1:53 UTC
Read the original article Hit count: 473

Filed under:
|

Hi,

What is the best method to test the existence of an attribute on an XML object in ActionScript 3 ?

http://martijnvanbeek.net/weblog/40/testing_the_existance_of_an_attribute_in_xml_with_as3.html is suggesting to test using

   if ( node.@test != node.@nonexistingattribute )

and I saw comments suggesting to use:

 if ( node.hasOwnProperty('@test')) { // attribute qtest exists }

But in both case, tests are case sensitive.

From the XML Specs : "XML processors should match character encoding names in a case-insensitive way" so I presume attribute name should also be match using a case-insensitive comparison.

Thank you

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3