save in variables the elements of an answer xml

0

How to record list elements from an xml?

that is, I have the answer that regeates me several elements and those elements save it in variables?

example:

For Each nd As Xml.XmlNode In record
   rec= New Response()
   rec.nombre = nd.Item("Nombre").InnerText
   rec.direccion = nd.Item("dir").InnerText
   rec.factura = nd.Item("folio").InnerText
   resp.ListaRecord.Add(rec)
Next

something like that

    
asked by Hector 04.01.2019 в 21:27
source

1 answer

0

There is a class called Document or XmlDocument in Vb to work with xml. You could load the xml with something like this:

 Dim xml = new Document
 Xml.loadxml(tu xml aquí)
 Dim nodes as xmlnodes=xml.selectnodes("tu ruta xpath               aquí")
 For i=0 to nodes.count - 1
 Variable=nodes(i)

 Next

Sorry, I have not worked with Vb for a while. Now I work with c #. I hope it helps ...

    
answered by 05.01.2019 в 15:49