We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Illegal character ((CTRL-CHAR, code 1))

While trying ouy XML merge for Aspose.Words for Java, I came upon the exception in the subject.

Here is the XML contents: illegal_character.zip (41.0 KB)

How am I supposed to find out where exactly is the “illegal character”? The exception message provides no useful information.


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

The problem is not in the “input document”, in fact it is independent of it, being an error in the XML.

I have been able to find the illegal character thanks to an editor which allows to show control chars too, however it would be better if the exception message at least told where the character is, for example line XX position YY.


Thanks for your inquiry. We have logged a ticket in our issue tracking system as WORDSJAVA-1779 to throw meaningful exception when reading XML using DataSet.readXML. Once we have any information about this issue, we will update you via this forum thread.


Thanks for your patience. We are closing this issue WORDSJAVA-1779 as “Won’t Fix”. The DataSet.readXML throws the following exception.

DataSet ds = new DataSet();
ds.readXml(MyDir + “illegal_character.xml”);

Exception in thread “main” com.aspose.words.net.System.Data.DataException: asposewobfuscated.zz0E: Illegal character ((CTRL-CHAR, code 1))
at [row,col

]: [1993,-292] // <------ row, col

You can get the information from [row,col] as shown above. The stack trace explains the detail of exception.