Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to combine strings & XML
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01086420
Message ID:
01086422
Views:
21
This message has been marked as the solution to the initial question of the thread.
...
lcXmlFIle = "test01.xml"
STRTOFILE(LcXMLFileHeader, lcXmlFIle)
...
Set Textmerge On
Set Textmerge To (lcXmlFIle) Noshow ADDITIVE
...
Set Textmerge To
Set Textmerge Off
STRTOFILE(LcXmlFileFooter, lcXmlFIle, .T.)
>i wantto create xml file from query;
>i should create xml file syntax like below,
>
>first,
>
><pre>
>LcXMLFileHeader = [<?xml version="1.0"?>]+;
>	[ <MainmsgBody> ]+;
>	[ <UserName>USR</UserName> ]+;
>	[ <PassWord>PWD</PassWord> ]+;
>	[ <Messages> ]
>
>
>then xml file body will come from query,
>
>
>Select * From data03\Customers Into Cursor CrsCustomers NOFILTER
>
>Select CrsCustomers
>Go Top
>
>Set Textmerge On
>Set Textmerge To ("test01.xml") Noshow
>
>For i=1 To Reccount()
>\<Message>
>\<Mesgbody><<ALLTRIM(CrsCustomers.custname)>></Mesgbody>
>\<Number><<ALLTRIM(CrsCustomers.gsm)>></Number>
>\</Message>
>	Skip In CrsCustomers
>Endfor
>Set Textmerge To
>Set Textmerge Off
>
>*MODIFY COMMAND test01.xml
>
>
>after created body text
>i should combine header+body+footer sections
>
>
>LcXmlFileFooter = [ </Messages> ]+;
>	[ <Type>1</Type> ]+;
>	[ <Originator></Originator> ]+;
>	[ <Sdate></Sdate> ]+;
>	[ <Edate></Edate> ]+;
>	[ </MainmsgBody> ]
>
>
>i've tried some combines tries but was not succesfull
>
>How would be shortway for this,
>
>header+footer section is static only body sections is dynamic
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform