I am sending a soap XMLHTTP request to a sharepoint web service. The response is wrapped in the soap xml as usual. The problem is that some "ows_###" row attributes are further encoded in HTML and some are not.
Example:
<z:row
ows_Title='Example'
ows_Who='Adam & Bill'
ows_Content='<div>This &amp; this is HTML.</div>'
ows_ID='1' />
Decoding the xml, the values are:
ows_Title = 'Example'
ows_Who = 'Adam & Bill'
ows_Content= '<div>This & this is HTML.</div>'
ows_Content is now HTML so I parse it to get the raw text:
'This & this is HTML.'
If I try to parse ows_Who as HTML I get an error due to the ampersand starting an escape sequence.
I can parse the HTML fine so long as I know it is HTML.
- How can I determine the encoding of each attribute?
- How can I force all attributes to be HTML encoded?