Issue
No documents or folders appear when clicking on a SharePoint document library in MacroView DMF despite the library being populated.
Error
If you encounter this issue, please generate an information level trace file and check to see if it contains the following error message:
System.Xml.XmlException: Hexadecimal value 0x[..] is an invalid character
If this error message appears please try the advice in this article.
Cause
When the DMF Client communicates with the DMF Service some responses are returned as XmlNode types.
If the SharePoint object model returns values that are invalid when included in XML, an InvalidOperationException is thrown when the response is deserialized by ASP.NET web services at the client.
The XmlTextReader does have a "Normalization" property which allows the XML reader to be more liberal and ignore invalid characters - but this option is not used within the automatically generated Web Service Client.
Resolution
Identifying documents with invalid characters
Use the identifier utility available below to identify problem documents in SharePoint Online.
- To analyse a single library enter the URL of the library (as in the example).
- To analyse all libraries in a site enter the URL of the site AND tick "All libraries?"
ASCII code document identifier
If you have a huge number of documents in your library, and the problem only just started happening, you can speed it up by just searching for documents modified in the last few days.
As the problem only occurs in Office documents only the file types listed are checked.
When the application has completed click on "Open the log folder" to review the list of affected documents.
Remove Invalid Characters
This error can be resolved in a number of ways, once the offending file(s) have been identified (see below):
- Ensure that metadata column values do not include/contain any invalid characters (see table below).
- Office documents may also contain some of these invalid characters within their custom properties. To rectify this issue, the Office file must be deleted from SharePoint and then re-uploaded once the custom properties have been cleaned.
Note that you will need to open the document with the web browser before editing the document properties. The invalid characters will show as a square box.
To fix: Go to the File menu and select Info, then
Or in the Custom properties
List of Invalid Characters
(We have only seen problem occur with ASCII 11 and 21 but any of the following would trigger the same issue).
The following table details the characters that are not valid for web services XML serialization.
0×00 | 0x0B | 0×10 | 0x1A | 0x7F | |
0×01 | 0x0C | 0×11 | 0x1B | ||
0×02 | 0x0E | 0×12 | 0x1C | ||
0×03 | 0x0F | 0×13 | 0x1D | ||
0×04 | 0×14 | 0x1E | |||
0×05 | 0×15 | 0x1F | |||
0×06 | 0×16 | ||||
0×07 | 0×17 | ||||
0×08 | 0×18 | ||||
0×19 |