dbTalk Databases Forums  

VFP 8: XML to table

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 8: XML to table in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chase Davis
 
Posts: n/a

Default VFP 8: XML to table - 12-02-2004 , 02:16 PM






Hey all

I'm new to XML, even newer to Fox, and I'm trying to write a short
program that will take some XML and dump it into a table. I'm working
in VFP8, which has a xmltocursor() function that looks like it'd do
what I want, but I keep getting errors about how the XML isn't
well-formed. There are other solutions -- XSLT, PHP, regular
expressions -- but I'd prefer to go the Fox route if possible. I'll be
tinkering for a while, but if anyone has done this before and could
help keep me from reinventing the wheel, I'd appreciate it.

Here's a slice of my troublesome XML:

<?xml version="1.0" encoding="UTF-8" ?>
- <ns1:award xmlns:ns1="http://www.fpdsng.com/FPDS">
- <ns1:awardID>
- <ns1:awardContractID>
<ns1:agencyID>4700</ns1:agencyID>
<ns1:PIID>GSASAMPLEAWARDBPACALL12</ns1:PIID>
<ns1:modNumber>0</ns1:modNumber>
<ns1:transactionNumber>0</ns1:transactionNumber>
</ns1:awardContractID>
- <ns1:referencedIDVID>
<ns1:agencyID>4700</ns1:agencyID>
<ns1:PIID>SPIERMAN2</ns1:PIID>
<ns1:modNumber>0</ns1:modNumber>
</ns1:referencedIDVID>
</ns1:awardID>
- <ns1:relevantContractDates>
<ns1:signedDate>2004-08-04 00:00:00</ns1:signedDate>
<ns1:effectiveDate>2004-08-04 00:00:00</ns1:effectiveDate>
<ns1:currentCompletionDate>2004-08-04
00:00:00</ns1:currentCompletionDate>
</ns1:relevantContractDates>


Thanks,

Chase Davis
Data Analyst
National Institute for Computer-Assisted Reporting

Reply With Quote
  #2  
Old   
Eric den Doop
 
Posts: n/a

Default Re: VFP 8: XML to table - 12-08-2004 , 02:18 AM






Hello, Chase!

I suggest you take a look at the XmlAdapter class which was introduced in
VFP8. See VFP Help for details on this class and let us know if you need
more help.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.