Tim:.. wrote:
> Hi,
>
> OK here is an extract from the XML document!
>
> ..XML..
>
<Project>
<Name>Test1</Name>
<Version>1.0</Version>
<Tasks>
<Task>
<ID>1</ID>
<Start>2004-03-26T08:00:00</Start>
<Finish>2004-03-28T17:00:00</Finish>
</Task>
<Task>
<ID>2</ID>
<Start>2004-03-29T08:00:00</Start>
<Finish>2004-03-30T17:00:00</Finish>
</Task>
</Tasks>
</Project>
>
> ..CODE..
>
> Dim myNodes(200,100)
>
> node=-1
>
> set oNodes=xml.selectNodes("/Project/Tasks/Task/Start")
>
> for each oNode in oNodes
> node=node+1
> for i=0 to 100
> myNodes(node,i) = oNode.text
> next
> response.Write(myNotes(node,0)) & "<br>"
> next
>
> This code produces a Type Mismatch error for 'myNodes'
>
The Response.Write line does not look correct. For one thing: it says
"myNotes" instead of "myNodes". For another, don't use parentheses around
the response.write argument: it can only screw you up. Try this:
response.Write myNodes(node,0) & "<br>"
FWIW, when I use this code with your xml document:
set oNodes=xmldoc.selectNodes("/Project/Tasks/Task/Start")
for each oNode in oNodes
Response.Write oNode.text & "<BR>"
next
I get the desired results:
2004-03-26T08:00:00
2004-03-29T08:00:00
So we can be sure your xpath syntax is correct.
What is the goal here? I don't understand the purpose of the myNodes array.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
|