Cita:
Empezado por CarlosArjonomia
2. Agregar Referencia a MSXML en Visual Basic 6.0:
Ve a Project > References.
Selecciona "Microsoft XML, v6.0" (o una versión compatible si no tienes la 6.0).
Dim xmlDoc As MSXML2.DOMDocument60
Dim csvNode As MSXML2.IXMLDOMNode
Dim csvValue As String
' Cargar el XML en un objeto DOMDocument
Set xmlDoc = New MSXML2.DOMDocument60
xmlDoc.async = False
' Asegúrate de que el XML se cargue correctamente
If xmlDoc.loadXML(yourXmlString) Then
' Buscar el nodo <tikR:CSV> usando su XPath
' Asegúrate de incluir el namespace si es necesario
xmlDoc.setProperty "SelectionNamespaces", "xmlns:tikR='https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/RespuestaSuministro.xsd'"
Set csvNode = xmlDoc.selectSingleNode("//tikR:CSV")
' Verificar si el nodo <tikR:CSV> fue encontrado
If Not csvNode Is Nothing Then
' Obtener el valor del nodo <tikR:CSV>
csvValue = csvNode.Text
MsgBox "El valor del CSV es: " & csvValue
Else
MsgBox "No se encontró el nodo <tikR:CSV>."
End If
Else
MsgBox "Error al cargar el XML."
End If
El envío lo hago mediante:
Set httpRequest = CreateObject("WinHTTP.WinHTTPRequest.5.1")
Si el moderador considera que no hay que poner códigos que no sean DELPHI, me lo indica.
|
gracias gracias, lo probaré.
Esperemos que sí. El moderador ha sido flexible, los de vb también aportamos.