Hello all,
I am having a problem with a NodeList object. even though it may at first seem like a fairly simple problem, I have found related articles in other forums with the same exact question, but never a definite solution. I am posting to this forum now hoping someone could help me.
My code is as follows:
[tt]
Function FindDistrictNode(strDistrict)
Dim objAttrList, objAttr, tempNode, strAttribute, objNodeList, strTemp
Set objNodeList = objXml.getElementsByTagName("district"
tempNode = 0
Do while not strAttribute = strDistrict or tempNode = objNodeList.length
set objAttrList = objNodeList.item(tempNode).attributes '<---
for each objAttr in objAttrList
if objAttr.name = "district" then
strAttribute = objAttr.value
End iF
Next
tempNode = tempNode + 1
set objAttrList = nothing
Loop
Set objDis = objNodeList.item(tempNode-1)
End Function
[/tt]
I've reached this code after multiple version that I've tried and none worked. I am obtaining the error '800a01a8', Object required: "objNodeList.item" for the line with the arrow, above.
If anyone knows the possible reasons, I would greatly appreciate any input.
Thanks in Advance.
Mili Skikic
I am having a problem with a NodeList object. even though it may at first seem like a fairly simple problem, I have found related articles in other forums with the same exact question, but never a definite solution. I am posting to this forum now hoping someone could help me.
My code is as follows:
[tt]
Function FindDistrictNode(strDistrict)
Dim objAttrList, objAttr, tempNode, strAttribute, objNodeList, strTemp
Set objNodeList = objXml.getElementsByTagName("district"
tempNode = 0
Do while not strAttribute = strDistrict or tempNode = objNodeList.length
set objAttrList = objNodeList.item(tempNode).attributes '<---
for each objAttr in objAttrList
if objAttr.name = "district" then
strAttribute = objAttr.value
End iF
Next
tempNode = tempNode + 1
set objAttrList = nothing
Loop
Set objDis = objNodeList.item(tempNode-1)
End Function
[/tt]
I've reached this code after multiple version that I've tried and none worked. I am obtaining the error '800a01a8', Object required: "objNodeList.item" for the line with the arrow, above.
If anyone knows the possible reasons, I would greatly appreciate any input.
Thanks in Advance.
Mili Skikic