示例 XML;
<root>
<cmdset>Set 1
<cmd>Command 1</cmd>
</cmdset>
<cmdset>Set 2
<cmd>Command 2</cmd>
</cmdset>
</root>
我只想从<cmdset>
标签中提取文本。示例代码;
Sub Main()
Dim doc As XmlDocument = New XmlDocument()
doc.Load("help.xml")
For Each Element As XmlElement In doc.SelectNodes("//cmdset")
Console.WriteLine(Element.InnerText)
Next
Console.Read()
End Sub
电流输出;
Set 1
Command 1
Set 2
Command 2
期望的输出;
Set 1
Set 2
谢谢请