Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with using XmlAdapter
Message
De
22/05/2005 14:57:54
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01016566
Message ID:
01016595
Vues:
24
>>It is very small. I will zip it and email it to you right now.
>>
>>Thank you for your help.
>
>Hi Dmitry,
>
>There're 3 extra bytes (0xEFBBBF) at the beginning of the XML string. They're called a byte order mark (BOM), part of the unicode standard. See http://www.unicode.org/unicode/faq/utf_bom.html#BOM for details. The bytes 0xEFBBBF denote the BOM in UTF-8. I don't know why XmlAdapter recognizes BOM in the file but not in the string. The workaround is easy.
oXml = CREATEOBJECT("XMLAdapter")
>*IF lcXml = CHR(0xEF) + CHR(0xBB) + CHR(0xBF)
>IF lcXml = 0hEFBBBF   && VFP9
>  oXml.LoadXML( SUBSTR(lcXml,4))
>ELSE
>  oXml.LoadXML( lcXml)
>ENDIF
>
Sergey,

Thank you for the explanation and work around. I did see those 3 bytes but didn't know what it was all about. Now I have two work- arounds, either copy to file and get it from the file or using SUBSTR() as you suggested.

Thank you for your help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform