0

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 &amp; Bill'
ows_Content='&lt;div&gt;This &amp;amp; this is HTML.&lt;/div&gt;'
ows_ID='1' />

Decoding the xml, the values are:

ows_Title = 'Example'
ows_Who = 'Adam & Bill'
ows_Content= '<div>This &amp; 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?
Adamarla
  • 739
  • 9
  • 20
  • Are you sure the error is because of the ampersand? Please share the error message you get. Note that & is the escape sequence in HTML for ampersand. You should be able to HTMLDecode it just fine. – Plamen G Mar 26 '15 at 20:36
  • 1
    The error is an invalid entity reference. That is due to the &. I have edited the question to clarify the problem. I don't know which attributes are returning HTML and which are not. – Adamarla Mar 27 '15 at 09:51

1 Answers1

0

Use the GetList web service to get the details of a list. RichText is one of the attributes of a field of the list.

Adamarla
  • 739
  • 9
  • 20