Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting ASCII file to XML file in VFP 7.0
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Converting ASCII file to XML file in VFP 7.0
Miscellaneous
Thread ID:
00664390
Message ID:
00664390
Views:
57
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
Next
Reply
Map
View

Click here to load this message in the networking platform