Test existence of xml attribute in as3
- by matb
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