Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLadapter's ToXML issue
Message
From
11/02/2007 17:27:25
 
 
To
01/02/2007 16:45:08
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01191639
Message ID:
01194609
Views:
17
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform