0

I don't know much about batch coding or vbscript. Anyway, what I have to ask right now is how to read specific data in an xml file using batch script or vbscript? The script would like to read empty tags or self terminate tags in xml. If the script found empty tags, it should output an error in a log file.

I have my XML here:

<author>
<fname>John</fname>
<lname>Doe</lname>
</author>
<institution>
<name/>
<city>Pork</city>
<country>Plate</country>
</institution>

Assuming, name tag is an error.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Yuan Ray
  • 23
  • 4

1 Answers1

0

You can use MSXML to parse XML from VBScript. The sample code is mostly in C++ or JScript but here's a page that helps you convert those samples to VBScript. And here's an old question that could probably be used as a start to read through the XML: Traversing all nodes in an XML file with VBScript

And to write the data to a file, you can use FSO (FileSystemObject).

Community
  • 1
  • 1
Hans Olsson
  • 54,199
  • 15
  • 94
  • 116