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:
01687980
Views:
30
This is what I also tried. And it works.
Thank you for confirming that this is "the only way"!

>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
"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
Previous
Reply
Map
View

Click here to load this message in the networking platform