Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Returning XML from a SOAP call

From: "Peter Olcott" <NoSpam@---------.--->
To: NULL
Date: 1/10/2009 2:02:00 PM
"Joe Fawcett" <joefawcett@n...> wrote in message 
news:esbc75wcJHA.5788@T......
>
>
> "Peter Olcott" <NoSpam@S...> wrote in message 
> news:84udnaQ2pqUWr_rUnZ2dnUVZ_r6dnZ2d@g......
>>
>> "Joe Fawcett" <joefawcett@h...> wrote in message 
>> news:gk72bp$en5$1@n......
>>>
>>>
>>> "Peter Olcott" <NoSpam@S...> wrote in message 
>>> news:v4ydnY_egMERcvjUnZ2dnUVZ_uOdnZ2d@g......
>>>> Is there any way to return XML from a SOAP call without 
>>>> the special characters such as "<" being encoded as 
>>>> &lt; ???
>>>>
>>> To be valid XML they have to encoded or within a CDATA 
>>> section, but that only applies to text within elements. 
>>> So if you were crafting your own service you could force 
>>> a CDATA section for the elements in question but 
>>> attribute values would still have to be encoded. I don't 
>>> know of any of the popular SOAP frameworks that allow 
>>> you to specify CDAT sections in their configuration.
>>
>> The system that we are using is gsoap.
>>
> Not one I've come across. But the fact is that either you 
> need non well-formed 'XML', in which case no 
> self-respecting system will do that, or you can use CDATA, 
> which is only a convenience anyway. No XML parser will 
> care whether you have: <data> 1 & l t ; 2</data> (spaces 
> for readability) or

None of several XML parsers are correctly parsing this form 
as XML, they are all parsing it as strings of text. In my 
case I have valid XML that is returned by a SOAP call. All 
of the special XML characters such as "<" and ">" are 
translated into &lt; and &gt; respectively, thus they are 
not recognized by the XML parsers as XML element brackets.

> <data><![CDATA[ 1 < 2 ]]></data>
> Strive to fix whatever system needs non well-formed XML to 
> operate or we'll end up with the same problems that beset 
> us with browsers that repair bad HTML.
>
> -- 
>
> Joe Fawcett (MVP - XML)
> http://joe.fawcett.name 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent