Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Read Xml File
 

Vbscript / Text Processing / Read Xml File

Get attributes from an XML file.

e.g. <node1 attribute1="value1" attribute2="value2">


Set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("c:\DCCUResults.xml")

For Each x in xmlDoc.documentElement.childNodes

For Each y in x.childNodes

strName = y.getattribute("name")
strVal = y.getattribute("value")

If strName = "ServiceTag" Then

Wscript.Echo strName & strVal

End If

Next
Next





Please note that a disclaimer applies to any code on this page.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript
     - Active Directory
     - Exchange
     - Files And Folders
     - General
     - Ms Office
     - Operating System
     - Processes And Services
     - Text Processing
          - Filter Text Lines Containing
          - Get Html Tag Content
          - Merge File Contents
          - Read Xml File
     - User Interaction
     - Web Servers