Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLTOCURSOR Strange Result
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
XMLTOCURSOR Strange Result
Miscellaneous
Thread ID:
00943638
Message ID:
00943638
Views:
70
I have a project taht returns an XML file from a PDA which gets imported to a VFP 8.0 application. I use the XMLTOCURSOR() function to get a cursor with which I can process the results. In testing, all worked well. And, of course, as we usually do, I had fairly small XML's to import for test purposes. When I put the project into live action, the working sets got much larger than I tested with and I began getting reports of 'Data Type Mismatch' when uploading the XML.

Well, it turns out that if an integer field in the XML has a value of zero (0) in the first record of the XML, then XMLTOCURSOR() converts the entire column of the cursor into a logical field with a value of .F. This was true of fields with floating point values too, but I got around that by defaulting the value to 0.0 and then the parser seemed to work. I was able to do a bit of fudging and made sure that the first record in the XML always had a non-zero value in it so the project can continue, but this is a kludge and not the best of practices.

It's interesting that this only occurred when the XML got large (like 800 records or larger) and the parsing operated correctly on smaller files.

If anyone has a better solution than forcing a value into the first integer field, I would appreciate a response.

Dick Harrold
=========================================
Dick Harrold [DickHarrold@Yahoo.com]
Next
Reply
Map
View

Click here to load this message in the networking platform