Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用批处理文件或vbscript读取xml数据?_Vbscript_Batch File - Fatal编程技术网

如何使用批处理文件或vbscript读取xml数据?

如何使用批处理文件或vbscript读取xml数据?,vbscript,batch-file,Vbscript,Batch File,我对批处理编码或vbscript知之甚少。无论如何,我现在要问的是如何使用批处理脚本或vbscript读取xml文件中的特定数据?脚本希望读取xml中的空标记或自终止标记。如果脚本发现空标记,则应在日志文件中输出错误 我的XML在这里: <author> <fname>John</fname> <lname>Doe</lname> </author> <institution> <name/> <

我对批处理编码或vbscript知之甚少。无论如何,我现在要问的是如何使用批处理脚本或vbscript读取xml文件中的特定数据?脚本希望读取xml中的空标记或自终止标记。如果脚本发现空标记,则应在日志文件中输出错误

我的XML在这里:

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

约翰
雌鹿
猪肉
盘子
假设名称标记是错误的。

您可以使用它从VBScript解析XML。示例代码主要是C++或JScript,但这有助于将这些样本转换为VBScript。 这里有一个老问题可能可以作为阅读XML的起点:

要将数据写入文件,可以使用(FileSystemObject)