Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a value from XML file without converting it to DBF
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01687978
Message ID:
01687979
Views:
39
Hi,

You need STREXTRACT() function:
m.lcXML=FILETOSTR("any.xml")
?STREXTRACT(m.lcXML, "<cmwo_name1>", "</cmwo_name1>")
?STREXTRACT(m.lcXML, "<cmwo_name2>", "</cmwo_name2>")
?STREXTRACT(m.lcXML, "<cmwo_name3>", "</cmwo_name3>")
MartinaJ

>Hi,
>
>I am experimenting with getting a value from an XML file without converting this XML file to an DBF.
>Here is an example. Say I have the following XML file:
>
><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
><VFPData>
>	<cm_system_preferences>
>		<cmwo_name1>N</cmwo_name1>
>		<cmwo_name2>Y</cmwo_name1>
>		<cmwo_name3>100</cmwo_name3>
>	</cm_system_preferences>
></VFPData>
>
>Say I want to get the value in the element by the name (e.g. by "cmwo_name1, or cmwo_name2, and so on).
>For example, I want to extract from the XML file that the setting of the "name cmwo_name2" is Y (True). Or that the value of the name "cmwo_name3" is 100.
>
>How do I do it in code?
>
>TIA
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform