Resolve InvalidOperationException Error: Invalid Special Characters hexadecimal value invalid characters

Use this article to resolve the following SPS process error:

[InvalidOperationException] There is an error in XML document...[XmlException]... hexadecimal value 0x1C is an invalid character.

This error stops the process unless you can locate the problem document and remove special characters (/ + < , > ; ' or " ) from a specific field.

  1. Try searching the documents in Synergize Web Explorer from the queue. The documents won’t be populated because one of the document fields contains a special character. By searching in Synergize explorer client you can find the documents with special characters.

  2. You can also search from SQL:

    1. Launch SQL Server Management Studio.

    2. Expand Databases and select a repository.

    3. Select New Query.

    4. In the New query window, enter the following query to retrieve all the documents with special characters.

      select fieldname,
      patindex('%[^ !-~]%' COLLATE Latin1_General_BIN,fieldname) as [Position], substring( fieldname,patindex ('%[^ !-~]%' COLLATE Latin1_General_BIN,fieldname),1) as [InvalidCharacter], ascii(substring(fieldname,patindex ('%[^ !-~]%' COLLATE Latin1_General_BIN,fieldname),1)) as [ASCIICode], In_DocID
      from RespositoryName.dbo.main
      where patindex('%[^ !-~]%' COLLATE Latin1_General_BIN,fieldname) >0 and workflowID$ = get the workflow ID from EMC.

      Tip: Replace the fieldname and RepositoryName expressions with the actual names in your environment.

  3. After you get the results, you can correct those values using the following query:

    Update [Database_Name].[dbo].[Main] set <Column_Name> = '<Correct Data>' WHERE in_docid = 'synxxxx';

    Tip: Some special characters are not visible to the human eye. Trust the query results. For all documents retrieved, delete and then re-enter the correct field values.