//FILE XMLExtensions.as //Version 1.0 (Compatible with Actionscript 1.0) //Modified March 31,2009 //Misc Functions that extend the XML Class _myTotalQuestionNodes = 0; function doCounter() { _myTotalQuestionNodes++; } XML.prototype.ignoreWhite=true; XML.prototype.contentType="text/xml"; XMLNode.prototype.ignoreWhite=true; XMLNode.prototype.getRootNode = function() { for (var i in this.childNodes) { if (this.childNodes[i].nodeType == 1) { return (this.childNodes[i]); } } }; XMLNode.prototype.findNodes = function(searchName,callback) { for (var i = 0; i0) { currentNode.findNodes(searchName,callback); } } }; XMLNode.prototype.getFirstNodeByName = function(myNodeName){ for (var i = 0; i")+2),myTempString.length); myTempString=substring(myTempString,0,myTempString.indexOf("<")); return (myTempString); } XMLNode.prototype.getTotalNodesByName = function(searchName) { _myTotalQuestionNodes = 0; this.getNextNode(searchName,doCounter); return(_myTotalQuestionNodes); }; XMLNode.prototype.getNextNode = function(searchName,callback) { if (this.nodeName == searchName) { callback(this); } for (var child = this.firstChild; child != null; child=child.nextSibling) { child.getNextNode(searchName,callback); } }; XMLNode.prototype.findNodesWithAttributeValue = function(searchName,callback) { for (var i = 0; i0) { currentNode.findNodesWithAttributeValue(searchName,callback); } } }; XMLNode.prototype.findNodesWithAttribute = function(searchName,callback) { for (var i = 0; i0) { currentNode.findNodesWithAttribute(searchName,callback); } } };