Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting ASCII file to XML file in VFP 7.0
Message
From
04/06/2002 11:43:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00664390
Message ID:
00664541
Views:
23
>I am looking for a way to convert an ASCII file into an XML file in VFP 7.0.
>I tried to use the cursortoxml function but I can't seem to use it because of all the special formatting(see below for a small sample).
>
>Can anyone steer me in the right direction. Much appreciated.
>
>
><HostFileExport>
>		<Batch>
>			<Header>
>				<BatchNumber>445</BatchNumber>
>				<BatchDate>20020524113059</BatchDate>
>				<SeqStartNumber>1</SeqStartNumber>
>				<P1OperatorID>user1</P1OperatorID>
>				<P2OperatorID>user1</P2OperatorID>
>				<DebitTotal>1234.56</DebitTotal>
>				<DebitCount>50</DebitCount>
>				<CreditTotal>1234.56</CreditTotal>
>				<CreditCount>50</CreditCount>
>			</Header>
>			<Item>
>				<Sequence>1</Sequence>
>				<Type>1</Type>
>				<PaidAmount>25.00</PaidAmount>
>				<TransactionType>3</TransactionType>
>				<MemberID>99101010</MemberID>
>				<ScanlineAmount>30.00</ScanlineAmount>
>				<SponsorCode>900</SponsorCode>
>				<FrcsCode>200</FrcsCode>
>				<FrcCode>100</FrcCode>
>				<DocumentControlNumber/>
>			</Item>
>
>
>For right now all I can think of is to hardcode the begin and end tags when creating the ascii file and fput after every line. The indenting I haven't thought of yet.
>
>thanks
>KJM

Isn't this already an XML w/o a schema ?
If I got it wrong and what you want to do is XML an hierarchical set then think of ADOrecordset.Save().
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform