I have an .xml file and can enumerate all the values I need, however I only
need to return the first Value.

strValue returns the correct string value but also all the other values in
the Array, how do I just get the first value rather than all values?

Below is my code:
'****************************
' Retrieve array of Node's
Set xmlRoot = xmlDoc.documentElement
Set nodelistID = xmlDoc.SelectNodes("SecScan/Check/Advice")

for each node in nodelistID
strTest = trim(node.text)
wscript.echo strTest
next

'*******************************

Thanks!

Re: Get First Node.text in Array by Anthony

Anthony
Thu May 11 01:47:22 CDT 2006


"firebladeboy" <firebladeboy@discussions.microsoft.com> wrote in message
news:B1F6D45F-4457-457B-A2A1-634C8407BAF2@microsoft.com...
> I have an .xml file and can enumerate all the values I need, however I
only
> need to return the first Value.
>
> strValue returns the correct string value but also all the other values in
> the Array, how do I just get the first value rather than all values?
>
> Below is my code:
> '****************************
> ' Retrieve array of Node's
> Set xmlRoot = xmlDoc.documentElement
> Set nodelistID = xmlDoc.SelectNodes("SecScan/Check/Advice")
>
> for each node in nodelistID
> strTest = trim(node.text)
> wscript.echo strTest
> next
>
> '*******************************
>
> Thanks!

strText = Trim(xmlDoc.selectSingleNode("SecScan/Check/Advice").Text)