Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor to XML not picking up lines
Message
De
12/06/2017 14:55:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01650938
Message ID:
01651934
Vues:
79
>...
>>>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).
>The file should have been sent to me in utf-8 and I thought that the utf-8/utf-16 string was a flag to show how it was to be interpreted rather than a storage format that modified the file itself.
>As it said utf-16 what I'm doing is using FileToStr and reading in the file. Then doing a StrTran to replace the utf-16 with utf-8. I'm also doing a StrConv(StrConv( , 11 ) , 2 ) to bring the file back to single byte format. Finally I'm doing a SubStr() of the file to exclude any characters before the first
<
. I then save the file as file1.txt and use FileToStr of this file but no joy. I know that I'm hovering around the solution and it does work if the data is in the prg file rather than coming from a variable so it's close but just can't get the last part over the line.
>~M

Just to get the things straight: the file you uploaded is exactly the file that you received, right?

I'm far from a VFP installation, at the moment, but later on into the night I will probably will have time to test for a solution (but I'm needing to know for sure if I will work with the source of your problems).
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform