Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor to XML not picking up lines
Message
 
To
13/06/2017 12:39:00
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01650938
Message ID:
01652055
Views:
77
>>>>...
>So, summing up: a reasonable approach would be to (a) always read the file contents into a string, (b) fetch and strip off the BOM, if there is one, (c) check for file contents consistency (that is, match between actual file encoding and declared XML encoding), (d) force consistency, if needed, by transforming the string, and then (e) .LoadXML() the result of previous steps.
I got the other company to send me new files as some of the existing ones were inconsistent.
I've attached one of the new xml files and with them I tried 2 things.
First up in the VFP 9 command window
LOCAL adapter as xmladapter
adapter = CREATEOBJECT("XMLAdapter")
adapter.RespectNesting = .T.
lcContent = FILETOSTR("Orders-150620171615_4480-3.xml")
adapter.LoadXML(SUBSTR(lcContent,4))
? adapter.tables.Count  --- this return 0
I also tried this instead of using lcContent, but still Count = 0
adapter.LoadXML("Orders-150620171615_4480-3.xml", .T., .F.)
I also tried the above after taking the file, opening it in notepad and then saving as ansi.
~M
Go raibh maith agat

~M
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform