Path: csiph.com!aioe.org!.POSTED.ml0SPdOkPcmyTH1Lj8knMg.user.gioia.aioe.org!not-for-mail From: "Sauro" Newsgroups: it.comp.lang.visual-basic Subject: Re: Importare dati da file xml con VB6 Date: Fri, 11 Oct 2019 11:10:56 +0200 Organization: Aioe.org NNTP Server Lines: 51 Message-ID: References: <41c31c38-00c4-44d0-bd3e-e3a2367aec90@googlegroups.com> NNTP-Posting-Host: ml0SPdOkPcmyTH1Lj8knMg.user.gioia.aioe.org X-Complaints-To: abuse@aioe.org X-MSMail-Priority: Normal X-Priority: 3 X-Notice: Filtered by postfilter v. 0.9.2 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 Xref: csiph.com it.comp.lang.visual-basic:19651 [cut] Ciao Lorenzo Non rispondo alla tua domanda ma ti offro un'altra possibilitā utilizzando la Sub che segue (non č farina del mio sacco) che forse, con le opportune modifiche, puā fare al caso tuo. La sub utilizza la variabile Stringa_DATI per memorizzare in modo descrittivo i nomi dei nomi coi relativi valori o attributi. Tu puoi utilizzare un altro sistema. Se vuoi limitare la ricerca puoi usare istruzioni come le seguenti: If xNode.nodeName = "DettaglioLinee" Then If xNode.parentNode.nodeName = "NumeroLinea" Then Nota che la Sub richiama se stessa per seguire tutti i nodi Public Sub DisplayNode(ByRef Nodes As MSXML2.IXMLDOMNodeList, ByVal Indent As Integer) 'Public Stringa_DATI as String ' Memorizza Nomi nodi e relativi valori o attributi 'Public Con_Attrubuti as Boolean ' Mettere = True se si vogliono anche gli attributi 'Public Con_Text as Boolean ' Mettere = True se si vogliono anche i testi Dim xNode As MSXML2.IXMLDOMNode Indent = Indent + 2 For Each xNode In Nodes If xNode.nodeType = NODE_ELEMENT And Con_Attributi Then ' NODE_ELEMENT = 1 Attributo = "" For Each Attrib In xNode.Attributes Stringa_DATI = Stringa_DATI & Space$(Indent) & "Attrib: " & xNode.nodeName & ":" & Attrib.nodeName & "=" & Attrib.Value & vbCrLf Next Attrib End If If xNode.nodeType = NODE_TEXT And Con_Text Then ' NODE_TEXT = 3 Stringa_DATI = Stringa_DATI & Space$(Indent) & xNode.parentNode.nodeName & ":" & xNode.nodeValue & vbCrLf End If If xNode.hasChildNodes Then DisplayNode xNode.childNodes, Indent End If Next xNode End Sub Ciao, Sauro