Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error 1943
Message
De
27/07/2022 04:21:41
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
À
26/07/2022 17:35:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01684725
Message ID:
01684735
Vues:
51
Hi, Luís,

>
>
>m.OROOT.selectNodes("Documento/dataobra").item(0).text 
>
>When i must used .item(x), always ? and it´s refer to content of my xml Tag ?

When you call the selectNodes method, you get in return a list of nodes. item(0) refers to the first element of the list (which will be .NULL., in case of a list of length zero), and item(0).text refers to the textual contents of the element (that may even be a complex element, comprising a segment of the XML tree and various sub-elements).

>Could you post a very, very smal example about using : verify the length of a node selection.
m.nodelist = m.OROOT.selectNodes("Documento/dataobra")
IF m.nodelist.length == 0
  *  the element does not exist
  * deal with it
ELSE
  * get the value from the first element of the list of selected nodes 
  m.dataobra = m.nodelist.item(0).text
ENDIF
(of course, you may define a function to ease the repetition of the construction).

Hope it helps!

Hi António,

thank you Antonio, without a doubt it helped me a lot to understand better how to do it!

Many thanks,
Best regards,
Luis
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform