|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Sep 2003
Città: Roma
Messaggi: 1997
|
[ASP e XML] qualcuno mi da una mano?
ciao
dovrei leggere questo file xml: Codice:
<xml xmlns:s='uuid:HGDAS8BG-GADS-77FT-4378-0000FGG7889S' xmlns:dt='uuid:HGDAS8BG-GADS-77FT-4378-0000FGG7889S' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'> <s:Schema id='SCHEMARIGHA'> <s:TipoElemento nome='riga' content='eltOnly' rs:CommandTimeout='30'> <s:TipoAttributo nome='articolo' rs:number='1' rs:nullable='true' rs:writeunknown='true'> <s:datatype dt:type='string' dt:maxLength='50'/> </s:TipoAttributo> <s:TipoAttributo nome='Codice' rs:number='2' rs:writeunknown='true'> <s:datatype dt:type='string' dt:maxLength='10' rs:maybenull='false'/> </s:TipoAttributo> <s:TipoAttributo nome='quantita' rs:number='4' rs:nullable='true' rs:writeunknown='true'> <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/> </s:TipoAttributo> <s:extends type='rs:rowbase'/> </s:TipoElemento> </s:Schema> <rs:dati> <z:riga articolo='esempio1' Codice='0000000001' Marca='prova1' quantita='2'/> <z:riga articolo='esempio2' Codice='0000000002' Marca='prova2' quantita='3'/> </rs:dati> </xml> ![]() se faccio cosi leggo la prima riga: Codice:
<%'Inizializziamo il Parser MS XML StrURL = "http://www.xxxxxxx.it/prova.xml" Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") objXMLHTTP.Open "GET", StrURL, false objXMLHTTP.Send content = objXMLHTTP.ResponseText set oXmlDoc = Server.CreateObject("MSXML2.DOMDocument") 'apri il file oXmlDoc.async = false oXmlDoc.loadXML (content) '------------ok legge il singolo elemento campo=oXmlDoc.selectSingleNode("//s:Schema/s:TipoElemento/s:TipoAttributo/@nome").text response.write("campo=" & campo & "<br>") dica quanti elementi ci sono nel nodo? dovre fare una cosa del tipo: Codice:
oXmlDoc.selectSingleNode("s:TipoAttributo[@nome='" & indice & "']).text ![]() e se voglio leggere gli elementi, sempre in base ad un indice, in questo nodo: Codice:
<rs:dati> <z:riga articolo='esempio1' Codice='0000000001' Marca='prova1' quantita='2'/> <z:riga articolo='esempio2' Codice='0000000002' Marca='prova2' quantita='3'/> </rs:dati> ![]() grazie in anticipo!! ![]()
__________________
I7 - 9700K - Gigabyte AORUS Z390 Pro - 32GB DDR4 G.Skill F4-3000C16S - EVGA GTX 1070 FTW - M2 EVO 970 PLUS 2TB - (Win10) - Crucial MX 2TB - EVO 860 500GB - (Mojave) - cooler master Real Power M850 - Corsair Hydro H115i ProRGB - Case Obsidian 500D - Monitor Asus MX279 - Bose Companion®5 - (Intel BOXNUC7I3BNH 8GB - SSD EVO 850 pro 500GB) (HTPC i5 2700k - GTX 1060) Ultima modifica di BlackWalker : 07-03-2009 alle 15:22. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Sep 2003
Città: Roma
Messaggi: 1997
|
Nessuno?
__________________
I7 - 9700K - Gigabyte AORUS Z390 Pro - 32GB DDR4 G.Skill F4-3000C16S - EVGA GTX 1070 FTW - M2 EVO 970 PLUS 2TB - (Win10) - Crucial MX 2TB - EVO 860 500GB - (Mojave) - cooler master Real Power M850 - Corsair Hydro H115i ProRGB - Case Obsidian 500D - Monitor Asus MX279 - Bose Companion®5 - (Intel BOXNUC7I3BNH 8GB - SSD EVO 850 pro 500GB) (HTPC i5 2700k - GTX 1060) |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Sep 2003
Città: Roma
Messaggi: 1997
|
up!
non ne esco ancora fuori...un aiuto? ![]() ![]()
__________________
I7 - 9700K - Gigabyte AORUS Z390 Pro - 32GB DDR4 G.Skill F4-3000C16S - EVGA GTX 1070 FTW - M2 EVO 970 PLUS 2TB - (Win10) - Crucial MX 2TB - EVO 860 500GB - (Mojave) - cooler master Real Power M850 - Corsair Hydro H115i ProRGB - Case Obsidian 500D - Monitor Asus MX279 - Bose Companion®5 - (Intel BOXNUC7I3BNH 8GB - SSD EVO 850 pro 500GB) (HTPC i5 2700k - GTX 1060) |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Sep 2003
Città: Roma
Messaggi: 1997
|
ultimo tentativo...nessuno che puo' gentilmente darmi un mano?
grazie! ![]()
__________________
I7 - 9700K - Gigabyte AORUS Z390 Pro - 32GB DDR4 G.Skill F4-3000C16S - EVGA GTX 1070 FTW - M2 EVO 970 PLUS 2TB - (Win10) - Crucial MX 2TB - EVO 860 500GB - (Mojave) - cooler master Real Power M850 - Corsair Hydro H115i ProRGB - Case Obsidian 500D - Monitor Asus MX279 - Bose Companion®5 - (Intel BOXNUC7I3BNH 8GB - SSD EVO 850 pro 500GB) (HTPC i5 2700k - GTX 1060) |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Sep 2003
Città: Roma
Messaggi: 1997
|
ok, chiedero altrove visto che qui nessuno ne sa niente!
byez!
__________________
I7 - 9700K - Gigabyte AORUS Z390 Pro - 32GB DDR4 G.Skill F4-3000C16S - EVGA GTX 1070 FTW - M2 EVO 970 PLUS 2TB - (Win10) - Crucial MX 2TB - EVO 860 500GB - (Mojave) - cooler master Real Power M850 - Corsair Hydro H115i ProRGB - Case Obsidian 500D - Monitor Asus MX279 - Bose Companion®5 - (Intel BOXNUC7I3BNH 8GB - SSD EVO 850 pro 500GB) (HTPC i5 2700k - GTX 1060) |
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12093
|
ma non puoi usare linq to xml che è una passeggiata?
![]() http://weblogs.asp.net/scottgu/archi...r-with-it.aspx
__________________
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Feb 2003
Città: Stockholm (SE)
Messaggi: 1343
|
oppure usare una query xpath
|
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Sep 2003
Città: Roma
Messaggi: 1997
|
allora da quanto ho capito, il file che devo leggere, non
è altro che un "XML Schema". solo che non riesco a trovare qualche esempio in ASP per leggerlo...per leggere gli attributi, e cosi via... nessuno che puo' darmi una mano (sono moolto arruginito ![]() indicarmi qualche link? grazie! (spero che qualcuno mi dia un mano ![]() ![]()
__________________
I7 - 9700K - Gigabyte AORUS Z390 Pro - 32GB DDR4 G.Skill F4-3000C16S - EVGA GTX 1070 FTW - M2 EVO 970 PLUS 2TB - (Win10) - Crucial MX 2TB - EVO 860 500GB - (Mojave) - cooler master Real Power M850 - Corsair Hydro H115i ProRGB - Case Obsidian 500D - Monitor Asus MX279 - Bose Companion®5 - (Intel BOXNUC7I3BNH 8GB - SSD EVO 850 pro 500GB) (HTPC i5 2700k - GTX 1060) |
![]() |
![]() |
![]() |
#9 | |
Senior Member
Iscritto dal: Feb 2003
Città: Stockholm (SE)
Messaggi: 1343
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 20:06.