Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.visual-basic > #19643

Importare dati da file xml con VB6

X-Received by 2002:a0c:9952:: with SMTP id i18mr19970069qvd.202.1569839135104; Mon, 30 Sep 2019 03:25:35 -0700 (PDT)
X-Received by 2002:aed:2b85:: with SMTP id e5mr24028582qtd.366.1569839134879; Mon, 30 Sep 2019 03:25:34 -0700 (PDT)
Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!o24no2923631qtl.0!news-out.google.com!x7ni308qtf.0!nntp.google.com!o24no2923625qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups it.comp.lang.visual-basic
Date Mon, 30 Sep 2019 03:25:34 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=213.174.167.133; posting-account=hYVdMwkAAAB3a9z5HuisN1LsB9PQ80DU
NNTP-Posting-Host 213.174.167.133
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <41c31c38-00c4-44d0-bd3e-e3a2367aec90@googlegroups.com> (permalink)
Subject Importare dati da file xml con VB6
From Lorenzo Bonetto <bezvero@gmail.com>
Injection-Date Mon, 30 Sep 2019 10:25:35 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 44
Xref csiph.com it.comp.lang.visual-basic:19643

Show key headers only | View raw


Buongiorno a tutti.
Ho provato a cercare info senza trovarne.
Il mio problema è il seguente.
Apro dei files xml (fatture elettroniche) che hanno una certa struttura.
Con queste istruzioni verifico la corretta apertura:


Dim Obj As DOMDocument
Dim Verifica as boolean
Set Obj = New DOMDocument
Obj.async = False
Verifica = Obj.Load(App.Path & "\rfe\" & a)


poi per estrarre un singolo dato uso:

Set Nodo = Obj.documentElement.selectNodes("FatturaElettronicaBody/DatiGenerali/DatiGeneraliDocumento/Numero")
RnumeroFatt = 0
For Each Nome In Nodo
     RnumeroFatt = Val(Nome.Text)
Next

Se però devo fare un loop su una collezione devo fare:

Set Nodo = Obj.documentElement.selectNodes("FatturaElettronicaBody/DatiBeniServizi/DettaglioLinee")
For Each Nome In Nodo
    Set Nodo1 = Obj.documentElement.selectNodes("FatturaElettronicaBody/DatiBeniServizi/DettaglioLinee/NumeroLinea")
    For Each Nome1 In Nodo1
    Next Nome1
Next Nome

il problema è che non funziona perchè credo che il ciclo For Each non sia il modo giusto per recuperare i valori.
Come posso evitare il ciclo annidato prelevando direttamente il campo ?

Se necessario posso linkare il file xml.

Grazie in anticipo se qualcuno vorrà aiutarmi.
Cordiali saluti,
Lorenzo.

Back to it.comp.lang.visual-basic | Previous | NextNext in thread | Find similar


Thread

Importare dati da file xml con VB6 Lorenzo Bonetto <bezvero@gmail.com> - 2019-09-30 03:25 -0700
  Re: Importare dati da file xml con VB6 "Sauro" <vicchi@crsscala.it> - 2019-10-11 11:10 +0200
  Re: Importare dati da file xml con VB6 "Sauro" <vicchi@crsscala.it> - 2019-10-11 11:30 +0200

csiph-web