We Recommend

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
This Getting Started volume starts with Web and Internet fundamentals and database concepts and design, and then progresses to topics including creating data-driven pages, building complete applications, implementing security mechanisms, integrating with e-mail, building reusable functions and components, generating data-driven reports and graphs, building Ajax-powered user interfaces, and much more.


Posted By

damarev on 05/10/07


Tagged


Versions (?)


xmlToArray


Published in: ActionScript 


  1. xmlToArray = function (_xml) {
  2. var _arr = new Array();
  3. for (var i = 0; i<_xml.childNodes.length; i++) {
  4. switch (_xml.childNodes[i].childNodes[0].nodeType) {
  5. case 1 :
  6. _arr[_xml.childNodes[i].nodeName] = xmlToArray(_xml.childNodes[i]);
  7. break;
  8. case 3 :
  9. _arr[_xml.childNodes[i].nodeName] = _xml.childNodes[i].childNodes[0].nodeValue;
  10. break;
  11. }
  12. }
  13. return _arr;
  14. };

Report this snippet 

You need to login to post a comment.