Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLadapter's ToXML issue
Message
From
11/02/2007 18:30:00
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
11/02/2007 17:27:25
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:
01194611
Views:
15
>>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.

Hi Alexsey,

It's been a while since I posted this and have since managed to find out that the issue was with the web service. The XMLAdapter converts the "&" to "&" for the XML. When the web service was receiving this via HTTP.Send() from VFP, the XML was somehow being truncated immediately at the "&". The programmer(s) of the web service have changed their code to avoid this.

Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform