Hi everyone!
I am trying to convert a method made in vb6 to xojo.
Could you please tell me if i am doing this right?
The original vb6 code is:
MuestraNodosCancelacion (ByRef Nodos As XmlNodeList)
Dim i As Integer
'ReDim ListaUUIDCancelacion(1)
Dim oNodo As MSXML2.IXMLDOMNode
For Each oNodo In Nodos
If oNodo.nodeName = "cfdi:Comprobante" Then
If oNodo.hasChildNodes Then
MuestraNodosCancelacion oNodo.childNodes
End If
ElseIf oNodo.nodeName = "cfdi:Emisor" Then
For i = 0 To oNodo.Attributes.length - 1
If oNodo.Attributes(i).baseName = "rfc" Then
EmisorCancelacionRFC = oNodo.Attributes(i).Text
End If
Next i
ElseIf oNodo.nodeName = "cfdi:Complemento" Then
If oNodo.hasChildNodes Then
MuestraNodosCancelacion oNodo.childNodes
End If
ElseIf oNodo.nodeName = "tfd:TimbreFiscalDigital" Then
For i = 0 To oNodo.Attributes.length - 1
If oNodo.Attributes(i).baseName = "UUID" Then
ListaUUIDCancelacion = oNodo.Attributes(i).Text
End If
Next i
End If
Next oNodo
The code i made in xojo is:
[code] MuestraNodosCancelacion (ByRef Nodos As XmlNodeList)
Dim oNodo As XmlNode
Dim attributeNode As XmlAttribute
Dim node As XmlNode
For i As Integer = 0 To Nodos.Length-1
node = Nodos.Item(i)
if node.Name = “cfdi:Comprobante” then
If node.ChildCount > 0 Then
MuestraNodosCancelacion Nodos.Xql(“child::cfdi:Comprobante”)
End If
ElseIf node.Name = “cfdi:Emisor” Then
EmisorCancelacionRFC = node.GetAttribute(“rfc”)
ElseIf node.Name = “cfdi:Complemento” Then
If node.ChildCount > 0 Then
MuestraNodosCancelacion Nodos.Xql(“child::cfdi:Complemento”)
End If
ElseIf node.Name = “tfd:TimbreFiscalDigital” Then
ListaUUIDCancelacion = node.GetAttribute(“UUID”)
end if
Next[/code]