XML & Web services: Problem with ampersand in xml
Hi All, I have a process that dynamically builds xml on the fly based on some request. This application uses entity reference to represent ampersand. (&) . Following is an example of the xml generated. var=xyz&sessionid=123 The problem arises when this xml is passed to some other system which flags it as not well formed due to the ampersand (&). Has any one encountered this problem before. Suggestions welcome
solution is to enclose problematic part of code into <code woth &, <, >, ', " characters> see: http://www.w3schools.com/xml/xml_cdata.asp for more info
the solution is to URL encode the data, which converts special chars (like &) into codes (eg '&' -> '&'). on the other end, the data needs to be unencoded google 'URL encode'