[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reserved character in XML element value



Hi David,

You're right, you should not have to escape the & character if it's 
within a <![CDATA[ wrapper.

Unfortunately, not every XML parser supports CDATA (especially the very 
early ones) and if the server is using a home-grown XML interpreter, 
then all bets are off.

Converting from & to &amp; should work anywhere/everywhere.  You should 
also change < to &lt;, and > to &gt;.  There are a few others that are 
recommended (though not necessarily required) as well.

On 6/4/2012 2:52 PM, David Baugh wrote:
>     Hello,
>
>
>     I have a data item on file that I'm inserting into an element before
>     posting it in a request. In this particular case, the data contains a
>     `&' which is causing server's  parser to error out. I do have it
>     wrapped in<![CDATA[  ...]]>. Obviously I'm misunderstanding  this,
>     since I thought occurrences of such  would be accepted if  inside this
>     wrapper.
>
>
>     Otherwise, am I correct in assuming that I'd need to search and replace
>     any occurrences of this with&amp; before assignment?
>
>
>     Thanks,
>
>
>     David
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------