xml script

Tech-Archive recommends: Fix windows errors by optimizing your registry



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








.



Relevant Pages

  • Re: xml 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 ... Dim oNode: Set oNode = oXDoc.selectSingleNode ...
    (microsoft.public.scripting.vbscript)
  • Re: help with html table (nested for-each/keys/matched template)
    ... You dont need XSL for such a trivial data extraction. ... The following script in xmlgawk will do all the data ... your XML data. ... there is a bug in your XML data. ...
    (comp.text.xml)
  • Re: Parsing XML File - PHP out of memory?
    ... I'm sure the script is not getting stuck somewhere, ... divided the XML file into several files. ... Load XML data a file ...
    (comp.lang.php)
  • Re: XSL transformation on XML data in SQL 2005 causes invalid character error
    ... Best is to bind the XML data as SqlXml or a binary blob... ... Now all I can imagine with the cause of the error is illegal XML. ... I'm calling the assembly in a SQL script in the Query Window from SQL ...
    (microsoft.public.sqlserver.xml)
  • Re: DOM-scripting -- FF problem
    ... A document can not be "served as XML"; ... If the document type was an XHTML document type, ... script code which would be necessary in order to achieve a Valid document ... markup characters are regarded literal characters without ...
    (comp.lang.javascript)