Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor to XML not picking up lines
Message
From
12/06/2017 09:56:39
 
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:
01651925
Views:
74
>>>>
>>>I've attached the xml file. I use FileToStr() with the xml file to convert into a string and then use the string in the load() command. I've also tried it with a strconv( , 11) with no joy.
>>>~M
>>
>>Your file has a UNICODE BOM at the beginning. It must be stripped off before passing it, as a string, to the XML parser. So you simply and preferably Load it, instead of LoadXML it, or SUBSTR(..., 3) before Load.
>Thanks, reckon I'm on the right track now but still stuck. I have the code read into a variable and I have the following so that it removes the first x characters.
>
lcContent = SUBSTR(lcContent,AT("<",lcContent,1), LEN(lcContent) - (AT("<",lcContent,1) - 1))
>I show this to screen and it looks okay. But if I try to use it I get the adapter.tables.Count = 0. If I StrToFile and then read it back in I get the same Unicode BOM error.
>~M

The document encoding is different from the one that is declared (UTF-16) and the parser is complaining at thar. If no one else steps in, I'll come back to you later, unless you find a solution for yourself (I'll have to go offline for a few hours).
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform