vbs Xml Comment tester la presence d'une variable ?
Bonjour
j'ai besoin de tester la presence d'une valeur dans un fichier XML avant de la lire.
Cette valeur n'est pas forcement presente.
mon code est
Code:
1 2 3 4 5 6 7 8 9 10 11
| For Each hostElement In objXmlDoc.selectNodes("/dbd-support-info/global/auth")
host_id = hostElement.selectSingleNode("auth_id").text
host_name = hostElement.selectSingleNode("name").text
host_description = hostElement.selectSingleNode("description").text
Set host_site_id = hostElement.selectSingleNode("//site_id") ' Permet de tester si le champ existe
If Not host_site_id Is Nothing Then
host_site_id = hostElement.selectSingleNode("site_id").text
Else
host_site_id = " "
End If |
et donc la commande 'if not xxx is nothing then' ne fonctionne pas .
Quelqu'un a t il deja utilisé cela
MErci