1
예제 XML;자식 노드를 처리하지 않음 ("SelectNodes"사용)
<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
는
을 기쁘게 감사
아마도'set'이 속성이되도록 XML을 변경하고 싶을 것입니다. ''내부 텍스트는' ' –