Views:
Scenario:
When attempting to open a document, the following error is shown;

System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSectionAnnotations.Read22_SectionAnnotations()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at DocuWare.Content.Shared.Implementation.Serialization.XmlBlobSerializer.<>c__DisplayClass2_0`1.<DeserializeAsync>b__0()
   at DocuWare.Content.Shared.Implementation.AsyncExecution.Run[TResult](Func`1 function)
   at DocuWare.Content.Shared.Implementation.Serialization.SerializeExtensions.<DeserializeAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at DocuWare.Content.Management.Implementation.Operations.Core.CoreReadSectionOperations`1.<GetAnnotationsAsync>d__19.MoveNext()


Solution:
This error occurs when the document cannot read an empty string from the ANNOTATIONS column within the _SEC table of the File Cabinet in the DWData database. This ANNOTATIONS column should not be filled with an empty string, if the document has no annotations, it should be set to a NULL value.
***Note: Ensure you have a valid backup of the DWData database before performing the steps listed in this KBA.***

1. Run the following query to replace the ANNOTATIONS value with NULL where the ANNOTATIONS value is an empty string:

MSSQL:
update [dwdata].[dbo].[SAMPLEEN_SEC] set ANNOTATIONS = null where cast(ANNOTATIONS as nvarchar(max)) = ''

MySQL:
update `dwdata`.`SAMPLEEN_SEC` set ANNOTATIONS = NULL where ANNOTATIONS = ''

2. Perform an MSMQ reset. If unaware of how this can be executed, please reference KBA-35787.

3. Once completed, clear the browser cache, and the documents will now open without error.

KBA is applicable to On-premise Organizations ONLY.