In your example you are using objNodeList.length to control the iteration of permit Details, but objNodeList is set using objNodeList = dom.getElementsByTagName(“permit”); so it contains only one (permit) Element.
If you use permitDetails.length to control your loop, you should iterate properly over all of the details.
I have attached a html/javascript example. test.html (726 Bytes)
Bill, Thanks this code works well now, but when I try to ust the get attributes feature of the dom it says that this is not supported by the tamino object so how do I capture the attribute names and values in tamino/javascript?:
var caseNumber = Request(“caseNumber”);
tamino = new ActiveXObject(“TAMINOX.TaminoX1”); tamino.Initialize(); tamino.csDatabaseURL(“http://mercury/tamino/govME/permits”); query = “/permits/permit[@caseNumber="”+caseNumber+“"]”; dom = tamino.doQuery(query); objNodeList = dom.getElementsByTagName(“permit”); //var permitNumber = dom.getElementsByTagName(“permit”); var permitDetails = dom.getElementsByTagName(“detail”);
Methods getAttributeNode() and getAttribute() apply to Elements, so before you use them you need to get from the DOM itself to the Element you’re interested in.
For example,
var permitNumber = objNodeList.item(0).getAttribute(“caseNumber”);
By the way, the full MSXML SDK including documentation is available at
tamino = new ActiveXObject(“TAMINOX.TaminoX1”); tamino.Initialize(); tamino.csDatabaseURL(“http://mercury/tamino/dev/permits”); query = “/permits/permit[@caseNumber="”+caseNumber+“"]”; dom = tamino.doQuery(query); objNodeList = dom.getElementsByTagName(“detail”); var permitDetails = dom.getElementsByTagName(“detail”); var recDate = objNodeList.item(0).getAttribute(“description”); var issueDate = objNodeList.item(1).getAttribute(“description”); var finalDate = objNodeList.item(2).getAttribute(“description”); var status = objNodeList.item(3).getAttribute(“description”); var comments = objNodeList.item(4).getAttribute(“description”); var typeWork = objNodeList.item(5).getAttribute(“description”); var numWC = objNodeList.item(6).getAttribute(“description”); var numSinks = objNodeList.item(7).getAttribute(“description”); var numWT = objNodeList.item(8).getAttribute(“description”); var gWHeater = objNodeList.item(9).getAttribute(“description”); var eWHeater = objNodeList.item(10).getAttribute(“description”);