Facing java.net.URISyntaxException while sending xml content as string to the Document object

Hi Team,


Iam getting java.net.URISyntaxException: Illegal character in query at index 54 exception when iam trying to send an wordml document as string to the Document constructor. Please find the following code used:

String input = getWordml(); \ getting wordml from my code and its written type is string

com.aspose.words.Document doc = new Document(input); \passing the string input to the document object.
While debug, when the control come here it throws the above exception and exists.

I have attached the sample wordml document which i tried to passed to create the Document object herewith for your reference.

Please give suggestions to get rid of this URISyntaxException.
Note : I am using aspose version : 15.1.0

The error trace :
at java.net.URI$Parser.fail(URI.java:2829)
at java.net.URI$Parser.checkChars(URI.java:3002)
at java.net.URI$Parser.parseHierarchical(URI.java:3092)
at java.net.URI$Parser.parse(URI.java:3044)
at java.net.URI.(URI.java:595)
at asposewobfuscated.zz9W.zzX6(Unknown Source)
at asposewobfuscated.zz9W.zzX8(Unknown Source)
at asposewobfuscated.zz9W.(Unknown Source)
at asposewobfuscated.zzLN.zzQ(Unknown Source)
at asposewobfuscated.zzLN.zzZ6(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)

Thanks,
Jagadeeswari.

Hi Jagadeeswari,


Thanks for your inquiry. After an initial test with Aspose.Words for Java 15.2.0, I was unable to reproduce this exception on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. I hope, this helps.

Best regards,

Hi Hafeez,


With this (15.1.0) version itself, when i save the xml document in my local path and then with the file path as input to the document constructor, I am not facing any error.

But in my application when I passed the wordml as string to the document constructor, I am getting this exception.

Thanks,
Jagadeeswari.

Hi Jagadeeswari,


Thanks for your inquiry. To ensure a timely and accurate response, please create a standalone runnable simple Java application (source code) that helps us reproduce your problem on our end and attach it here for testing. As soon as you get this simple application ready, we’ll start investigation into your issue and provide you more information.

Best regards,