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 |