Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLadapter's ToXML issue
Message
De
11/02/2007 17:27:25
 
 
À
01/02/2007 16:45:08
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01191639
Message ID:
01194609
Vues:
16
>I'm using an XMLADAPTER to create some XML of nested tables. Things are working fine except when the data contains those "special" characters - & in particular.
>
>In one of the fields that stores a name, the ampersand character is used and that causes the XML to be truncated when received at a web service. If I manually edit the XML to substitute "&" with "and" things are fine. I know that I need to encode & with '%26' or '&' (or simply change it to "and"). Is there any property/method of the XMLADAPTER to automatically do this?
>
>TIA
>Mike

Hi Mike,

Could you provide a simple example with code?
The following code works without any problems:
clear
set memowidth to 120
create CURSOR test(f1 c(10))
insert into test values (REPLICATE("&",5))

local oXA as XMLAdapter
oXA=CREATEOBJECT("XMLAdapter")
oXA.XMLSchemaLocation=""
oXA.AddTableSchema("test")

oXA.ToXML("cXML")
?cXML

oXA.LoadXML(cXML)
oXA.Tables(1).ToCursor(.F.,"test2")

select test2
?ALIAS()
list
Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform