Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question on processing XML file
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00854652
Message ID:
00854672
Vues:
34
This message has been marked as a message which has helped to the initial question of the thread.
Hi Dmitry,

You can do that with pure VFP code or you can use XMLTOCURSOR().
XMLTOCURSOR(lcXml, "crsXml")
* Or
lcStr = STREXTRACT(lcXml, "<service>", "</service>")
lnTotItems = OCCURS("<add", lcStr)
FOR lnItem = 1 TO lnTotItems
	lcKey = EVALUATE(ALLTRIM(STREXTRACT(lcStr, "<add key=", "value=", lnItem)))
	lcVal = EVALUATE(ALLTRIM(STREXTRACT(lcStr, "value=", "/>", lnItem)))
	? lnItem, lcKey, lcVal
ENDFOR
>How would I process the following XML file?:
>
>
><?xml version="1.0"?>
><service>
>   <add key="key1" value="value1" />
>   <add key="key2" value="value2" />
></service>
>
>
>I want to extract values corresponding to different keys in the file.
>
>TIA for any suggestions.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform