如何读取XML中的内容
QTP代码如下:Dim StringA
Environment.LoadFromFile("C:\EnvironmentValue.xml")
StringA=environment.Value("Username")
msgbox StringA
XML代码如下:
<?xml version="1.0" encoding="utf-8" ?>
<note>
<Username>Admin</Username>
<password>password</password>
</note>
就是取不到Username的值
哪位大虾指点下,不胜感谢~ http://www.cnblogs.com/beagles/archive/2006/11/07/552752.html Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("c:\test.xml")
Set Elem= xmlDoc.getElementsByTagName("Username")
username = Elem.item(0).Text
MsgBox username
页:
[1]