Relation XML imbriqué

xabs55 Messages postés 4 Date d'inscription mardi 28 octobre 2003 Statut Membre Dernière intervention 27 février 2006 - 22 févr. 2006 à 10:30
xabs55 Messages postés 4 Date d'inscription mardi 28 octobre 2003 Statut Membre Dernière intervention 27 février 2006 - 27 févr. 2006 à 09:05
Bonjour,



Je suis entrain de créer une routine qui alimente une base access à partir de fichiers XML.



Un de ces fichiers contient une table imbriquée comme dans l'exemple suivant :

Ma question est comment atteindre la table LIBAGPARTAGE de chaque bien ?




<?xml version="1.0" encoding="ISO-8859-1"?>





<NUMEROBIEN>CHALO-510-V</NUMEROBIEN>

<DATE_DERNIERE_MAJ>20060221</DATE_DERNIERE_MAJ>

<HEURE_DERNIERE_MAJ>1055</HEURE_DERNIERE_MAJ>

<LIBAGPARTAGE>ANGCT</LIBAGPARTAGE>

<LIBAGPARTAGE>ANGNO</LIBAGPARTAGE>

<LIBAGPARTAGE>ANGSU</LIBAGPARTAGE>

<LIBAGPARTAGE>SEICH</LIBAGPARTAGE>





<NUMEROBIEN>CHALO-521-V</NUMEROBIEN>

<DATE_DERNIERE_MAJ>20060216</DATE_DERNIERE_MAJ>

<HEURE_DERNIERE_MAJ>1459</HEURE_DERNIERE_MAJ>

<LIBAGPARTAGE>ANGCT</LIBAGPARTAGE>

<LIBAGPARTAGE>ANGNO</LIBAGPARTAGE>

<LIBAGPARTAGE>ANGSU</LIBAGPARTAGE>

<LIBAGPARTAGE>SEICH</LIBAGPARTAGE>







Merci de votre aide

Xabs

2 réponses

michelxld Messages postés 402 Date d'inscription vendredi 6 août 2004 Statut Membre Dernière intervention 12 octobre 2008 32
22 févr. 2006 à 20:09
bonsoir

je ne suis pas sur d'avoir bien compris mais tu peux essayer

'necessite d'activer la reference Microsoft Xml 3.0
Dim xmlDoc As DOMDocument
Dim xmlElem As IXMLDOMElement
Dim i As Integer


Set xmlDoc = New DOMDocument
xmlDoc.async = False
xmlDoc.Load "C:\Documents and Settings\michel\dossier\biensAgence.xml"


For Each xmlElem In xmlDoc.getElementsByTagName("BIEN")
For i = 0 To xmlElem.childNodes.Length - 1
If xmlElem.childNodes(i).baseName = "LIBAGPARTAGE" _
Then Debug.Print xmlElem.childNodes(i).Text
Next i
Next

bonne soiree
michel
0
xabs55 Messages postés 4 Date d'inscription mardi 28 octobre 2003 Statut Membre Dernière intervention 27 février 2006
27 févr. 2006 à 09:05
Je vais assayer ça, mais n'existerrais t'il pas une solution utilisant un dataset ?



Xabs
0
Rejoignez-nous