Check if XML attribute exists


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Usage 1:
  2.  
  3. var hasAttribute:Boolean = node.hasOwnProperty("@myAttribute");
  4.  
  5.  
  6. Usage 2:
  7.  
  8. var myList:XMLList = myXML.node.( hasOwnProperty( "@myAttribute" ) );
  9.  
  10.  
  11. Usage 3:
  12.  
  13. if ("@myAttribute" in node) { ... }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.