Hey there Sytze,

I feel your pain - I truly do!

A bit over 3 years ago, at my current job - one of the 1st really big 
projects I got was to convert EDI 850 data coming from Mexico into our 
database system. The problem was that it was not the regular format (I 
think its called X12 or something cryptic like that). Instead, the 
mexicans were using the XML standard. So, I started doing a ton of 
research into handling XML within VFP. Although, the other problem was - 
I was limited to using VFP7 for this project - since that's what the 
system was running under for our client - while actually VFP9 had some 
more advanced commands for XML that VFP7 did not.

Long story short - I was even looking into all the Schema stuff - and 
understood that you supposedly had to have the Schema - in order for you 
to properly do an XML to Cursor type conversion in VFP. I spent hours 
and HOURS researching and trying to figure stuff out. And, even posted 
messages for help here on the ProFox list. In the end, however, as I was 
getting frustrated - I came across a Sample chunk of code in the VFP 
Online help system. If you go and look up the command called 
STREXTRACT() - you will also stumble upon this GREAT Chunk of code for a 
PROCEDURE called XmlProc. Well, I just implemented that procedure, and 
made a couple more routines that essentially work with XmlProc - and 
that's how I ended up getting things to work.

I know its not as ellegant as using the proper XmlToCursor command, and, 
honestly - I can't tell you why your code below does not work. But, with 
a bit of work I think that XmlProc procedure can do what you need done.

Anyway - I hope that helps - and, of course, with XmlProc - YMMV...

Goodluck!
-K-

P.S. If you had written the posting earlier in the day - and I was at 
work - I could have looked up my code and given you some more code 
snippets - but, alas - its Friday night - and I am home and chillin' out...


On 6/15/2012 9:11 PM, Sytze de Boer wrote:
> Friends, I need some help
>
> I need to import data from an XML file into a cursor/table
> I use the following line
>        XMLTOCURSOR( (cXMLfile),"xmldata",512)
> and it gives me a beautiful cursor
> EXCEPT a whole lot of vital data is missing (fields)
>
> Example, herewith a number of lines from the file
> <?xml version="1.0" encoding="UTF-8"?>
> -<psr:CounterNotification xmlns:psr="urn:CounterList">
> <Date>2012-06-15T10:14:27</Date> <SendSetting Timing="SCHEDULE">
> </SendSetting> <MachineModel>TOSHIBA e-STUDIO2500c</MachineModel>
> <SerialNumber>CBA717996</SerialNumber> -<SupplierInfo> <SplName/>
> <Fax/> <Email/> <SplAddress/> </SupplierInfo> -<CustomerInfo>
> <CustName>Copy Service</CustName> <CustTelNumber/> <CustEMail/>
> <CustAddress/>
>
> My cursor gives me splname, fax,email,spladdress, custname
> I NEED the Serialnumber, plus a whole bunch of other fields it seems to skip
>
> I've checked for xml to csv file converters, but given up
> Is there anyone who can help me convert this type of file into a
> cursor or dbf or csv file?
>



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to