Hello,
I have an XML file as shown below:
<?xml version="1.0" encoding="iso-8859-1" ?>
MILON
ODILE
6 RUE FREDERIC MISTRAL
<code_postal>83250</code_postal>
LA LONDE LES MAURES
00494159681
Fenêtres
Portes d’Entrée
Volets
Bois
PVC
Aluminium
<offre_financement>Non
</offre_financement>
demande de devis pour changer 2 fenêtres et peut-être l’encadrement bâti dans 2 chambres.
I am creating the Microsoft.XMLDOM object as follows:
Set source = CreateObject(“Microsoft.XMLDOM”)
source.async = False
'Sets the validateOnParse property to false
'source.validateOnParse =False
'This line loads the XML into the parser.
source.load(sourceFile)
This function below is retrieving the elements based on the tag.
Function ElementsByTagName(source,Tag As String)As Variant
Dim XMLList() As String
Set x=source.getElementsByTagName(Tag)
On Error Goto Erreur
Redim XMLList(1 To x.length)
For i = 1 To x.length
XMLList(i)=(x.item(i-1).text)
Next
ElementsByTagName=XMLList
Exit Function
Erreur:
XMLList(1)=False
ElementsByTagName=XMLList
End Function
I am encountering a problem when I have to retrieve the elements below:
Fenêtres
Portes d’Entrée
Volets
Since the tag is , I am getting the elements “Fenêtres Portes d’Entrée Volets” together and all the three elements are going into one field. The problem is that “Fenêtres”, “Portes d’Entrée” and “Volets” should go in three different fields.
How can I retrieve the elements separately?
Thxs in advance