Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check if and add element to XML file
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Check if and add element to XML file
Divers
Thread ID:
01659959
Message ID:
01659959
Vues:
96
Hi,

I am looking for an efficient way to check if an XML has an element, and if the element does not exist, add it.

Here is an example:
MyFile.xml:
<?xml version="1.0" standalone="yes" ?>
<Setting>
   <MyElement1>123</MyElement1>
</Setting>
Say, I want to find if this file (e.g. MyFile.xml) has element "MyElement2". And if not, add it.
I can do it with FILETOSTRING(), STRTOFILE(), and STREXTRACT() functions. But I am not sure if this is the most efficient approach.

Any suggestions? TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform