0

I am using the asset library tech experience to fetch the list from sharepoint

ListService.Lists objLists = new ListService.Lists();
objLists.Credentials = Constant.credentials;
objXMLDocument = new XmlDocument();
objXMLDocument.LoadXml("<QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><Folder>Tech Experience</Folder><ViewAttributes Scope=\"RecursiveAll\" /></QueryOptions>");
XmlNode objQueryOptions = objXMLDocument.DocumentElement;
resultXml = objLists.GetListItems("Tech Experience", null, null, null, "100", objQueryOptions, null);

It throws this error "Error in xml Document" on executing the last line in the given code.

But if I change the asset library in the loadxml(ie from tech Exprience to something else) it works fine.

What I find till now is, the description of items available on this Asset Library contains some special characters like(',",<,>,&) which is creating problem.

Please correct me if I am wrong.

I can not ask my client not to use these characters while uploading new files.

How can I overcome this problem?

1 Answer 1

0

You will need to encode those characters as HTML entity characters:

  • '&' as &amp;
  • '<' as &lt;
  • '>' as &gt;
  • ''' as &apos;
  • '"' as &quot;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.