Imports System.Xml
Public Class Form1
Private Sub btnok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnok.Click
Dim doc As New XmlDocument
doc.Load("archivo.xml")
'For Each node As XmlNode In doc.GetElementsByTagName("tcv")
' 'MessageBox.Show(node.OuterXml)
' If node.Name = "folio" Then
' MessageBox.Show("!")
' End If
'Next
Dim nodes As XmlNodeList = doc.SelectNodes("data/tcv")
For Each node As XmlNode In nodes
'MessageBox.Show("TAbla:" & node("tabla").InnerText & " " & "campo:" & node("campo").InnerText)
Dim str As String = node.OuterXml
'Dim x As XmlElement = node.ParentNode
doc.LoadXml(str)
Dim varnodes As XmlNode = doc.SelectSingleNode("tcv/variables")
'MessageBox.Show(node.OuterXml)
Next
'doc.Save("archivo.xml")
End Sub
End Class
<?xml version="1.0" encoding="utf-8"?>
<data>
<tcv>
<tabla>hist_DTE</tabla>
<campo>tipo_DTE</campo>
<var1>mitipodte=33</var1>
</tcv>
<tcv>
<tabla>DTE_recibos</tabla>
<campo>folio</campo>
<variables>
<var>foliodeldte=68976</var>
<var>foliodeldte=68976</var>
</variables>
</tcv>
</data>
No hay comentarios.:
Publicar un comentario