-
Read XML with VBScript
Hi,
I'm new to working with XML files and I'm trying to find a good tutorial on how to access each element of a file using VBScript. For example, consider the following sample XML:
Code:
<queryList>
<query id="1">
<qryDesc>My First Query</qryDesc>
<sql>SELECT * FROM tblUsers</sql>
</query>
<query id="2">
<qryDesc>My second Query</qryDesc>
<sql>SELECT stuff FROM tblUsers</sql>
</query>
</queryList>
I've been reading up on MSXML2.DOMDocument but I can't seem to find a good straight forward response on how to access each portion of the file. Basically what I'm looking for is the code to output the following:
Node name: queryList
Node name: query
Attribute name: id
Attribute value: 1
Node name: QryDesc
Value: My First Query
Node name: sql
Value: SELECT * FROM tblUsers
Node name: query
Attribute name: id
Attribute value: 2
Node name: QryDesc
Value: My Second Query
Node name: sql
Value: SELECT stuff FROM tblUsers