src/aria/utils/Xml.js
function (xmlNode) {
            if (!xmlNode) {
                return;
            }
            var node = {};
            for (var i = 0; i < xmlNode.childNodes.length; i++) {
                var currNode = xmlNode.childNodes[i];

                // if it's a text node or a CDATA section use the nodeValue directly
                if (currNode.nodeType != 3 && currNode.nodeType != 4) {
                    var name = currNode.nodeName;
                    var count = 0;
                    for (var j = 0; j < xmlNode.childNodes.length; j++) {
                        if (xmlNode.childNodes[j].nodeName == name) {
                            if (++count == 2) {
                                break;
                            }
                        }
                    }
                    var el = this.__parseXmlNode(currNode);
                    if (count == 2) {
                        if (node[name] == null) {
                            node[name] = [];
                        }
                        node[name].push(el);
                    } else {
                        node[name] = el;
                    }

                } else if (xmlNode.childNodes.length == 1) {
                    node = currNode.nodeValue;
                }
            }
            return node;
        }
function (xmlNode) {
            if (!xmlNode) {
                return;
            }
            var node = {};
            for (var i = 0; i < xmlNode.childNodes.length; i++) {
                var currNode = xmlNode.childNodes[i];

                // if it's a text node or a CDATA section use the nodeValue directly
                if (currNode.nodeType != 3 && currNode.nodeType != 4) {
                    var name = currNode.nodeName;
                    var count = 0;
                    for (var j = 0; j < xmlNode.childNodes.length; j++) {
                        if (xmlNode.childNodes[j].nodeName == name) {
                            if (++count == 2) {
                                break;
                            }
                        }
                    }
                    var el = this.__parseXmlNode(currNode);
                    if (count == 2) {
                        if (node[name] == null) {
                            node[name] = [];
                        }
                        node[name].push(el);
                    } else {
                        node[name] = el;
                    }

                } else if (xmlNode.childNodes.length == 1) {
                    node = currNode.nodeValue;
                }
            }
            return node;
        }
function ( xmlNode ) { if ( ! xmlNode ) { return ; } var node = { } ; for ( var i = 0 ; i < xmlNode . childNodes . length ; i ++ ) { var currNode = xmlNode . childNodes [ i ] ; // if it's a text node or a CDATA section use the nodeValue directly if ( currNode . nodeType != 3 && currNode . nodeType != 4 ) { var name = currNode . nodeName ; var count = 0 ; for ( var j = 0 ; j < xmlNode . childNodes . length ; j ++ ) { if ( xmlNode . childNodes [ j ] . nodeName == name ) { if ( ++ count == 2 ) { break ; } } } var el = this . __parseXmlNode ( currNode ) ; if ( count == 2 ) { if ( node [ name ] == null ) { node [ name ] = [ ] ; } node [ name ] . push ( el ) ; } else { node [ name ] = el ; } } else if ( xmlNode . childNodes . length == 1 ) { node = currNode . nodeValue ; } } return node ; }
Internal method used for parsing the nodes of a xml document
@param {XmlNode} xmlNode Xml node to be parsed
@return {Object} Json object representing a xml node
Internal method used for parsing the nodes of a xml document