Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to combine strings & XML
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to combine strings & XML
Miscellaneous
Thread ID:
01086420
Message ID:
01086420
Views:
74
Hi All,
i wantto create xml file from query;
i should create xml file syntax like below,

first,
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

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform