xml script
- From: "info" <info@xxxxxxxxxxxxxxxx>
- Date: Fri, 22 May 2009 20:27:48 +0200
Can anybody help me with this script.
I have a script that read xml data , but i get a error in the For each
loop.
Microsoft VBScript runtime error: Object doesn't support this property or
method
I want to read all the lines ther are more data, it works fine with one
line, if i marked the for each line and the Next line.
Dim sFSpec : sFSpec = ".\UniversalManifest.xml"
Dim sXPath : sXPath = "//Package"
Dim sAttr : sAttr = "version"
Dim sAttr1 : sAttr1 = "postdate"
' need a FSO for pathes and IO
Dim oFS : Set oFS = CreateObject( "Scripting.FileSystemObject" )
sFSpec = oFS.GetAbsolutePathName( sFSpec )
' Create an XML Document Object and specify XPath (to be on the safe side)
Dim oXDoc : Set oXDoc = CreateObject( "Msxml2.DOMDocument.3.0" )
oXDoc.setProperty "SelectionLanguage", "XPath"
' Load XML file
oXDoc.async = False
oXDoc.Load sFSpec
' Return the node for sXPath
Dim oNode : Set oNode = oXDoc.selectSingleNode( sXPath )
For Each objnode In oNode
If oNode Is Nothing Then
WScript.Echo "not found"
Else
WScript.Echo oNode.getAttribute( sAttr ) & " -" &
oNode.getAttribute( sAttr1 )
End If
Next
.
- Follow-Ups:
- Re: xml script
- From: ekkehard.horner
- Re: xml script
- Prev by Date: Re: Vista/7 permissions for script?
- Next by Date: Re: oops, should have mentioned StdRegProv Class
- Previous by thread: Startup Script Via GPO... Where Are Parameters Stored?
- Next by thread: Re: xml script
- Index(es):
Relevant Pages
|