var XMLNodesByAttNodes = new Array(); function XMLgetElementsByAtt(node,att,attname) { XMLNodesByAttNodes = []; XMLgetElementsByAttFunktion(node,att,attname); return XMLNodesByAttNodes; } function XMLgetElementsByAttFunktion(node,att,attname) { for (var i = 0; i < node.childNodes.length ; i++) { nestCount = node.childNodes[i].childNodes.length ; if (node.childNodes[i].nodeType == 1) { var a = node.childNodes[i].getAttribute(attname); if (a==att) { XMLNodesByAttNodes[XMLNodesByAttNodes.length] = node.childNodes[i]; } } if (node.childNodes[i].childNodes.length) { XMLgetElementsByAttFunktion(node.childNodes[i],att,attname) } } } function XMLgetElementById(node,idname) { var a; var retnode = null; for (var i = 0; i < node.childNodes.length ; i++) { nestCount = node.childNodes[i].childNodes.length ; if (node.childNodes[i].nodeType == 1) { a = node.childNodes[i].getAttribute("id"); if (a==idname ) { return node.childNodes[i]; } } if (node.childNodes[i].childNodes.length) { retnode = XMLgetElementById(node.childNodes[i],idname); if (retnode) { return retnode; } } } return retnode; } function MygetTextByTagName(node, tagName) { var XMLElementsByTagName = new Array(); XMLElementsByTagName = node.getElementsByTagName(tagName); return MygetText(XMLElementsByTagName); } function MygetText(XMLElementsByTagName) { var text = new Array(); var textNodeContents; var chld; if (XMLElementsByTagName.length > 0) { for (var i = 0; i < XMLElementsByTagName.length ; i++) { textNodeContents = ""; for(chld = XMLElementsByTagName[i].firstChild; chld; chld = chld.nextSibling) { if (chld.nodeType == 3) { // text node textNodeContents += chld.data; } } text[text.length] = textNodeContents; } } return text; }