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

Free Support Forum - aspose.com

LINQ & UTF8 Problems

We are having a problem with LINQ reporting engine when the XML tags being processed contain UTF-8 Characters.


See attached files.

XML Looks like:

<?xml version="1.0" encoding="UTF-8"?>
<ÂRequirement>
Overview
</ÂRequirement>
<ÂRequirement>
Activity Professional Suite
</ÂRequirement>

Word Template Looks Like:

<span style=“font-family:
“Arial”,“sans-serif””><<foreach [in
<span style=“font-size:9.5pt;font-family:“Arial”,“sans-serif”;color:#333333”>ÂRequirement<span style=“font-family:“Arial”,“sans-serif””>]

<o:p></o:p>

· <>- <>

<>

When using the LINQ Reporting Engine we get the following error:

?Requirement( ): Type Summary

An error has been encountered at the end of expression 'in ?'. Character '?' was

unexpected at this position.


Hi Mark,


Thanks for your inquiry. Have you tried Aspose.Words for Java 15.8.0?
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

In case the problem still remains, please attach simplified source code to reproduce this issue on our end.

Best regards,

I have verified that we are using Aspose.Words for Java 15.8.0!


NOTE: A simplified example was attached to the first post.

Hi Mark,


Thanks for your inquiry. You have attached template Word document and XML data file with your first post. However, please also attach simplified Java source code you used to build report on your end.

Best regards,

Here is the java for this example.


package word;

import com.aspose.words.*;
import com.aspose.words.net.System.Data.DataSet;

import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

public class TestImport {
public static void main(String[] args)
{
try {
Document doc = new Document(“TemplateWithUTF8.doc”);
ReportingEngine engine = new ReportingEngine();

DataSet ds = new DataSet(“items”);
ds.readXml(“data4.xml”);

engine.buildReport(doc, ds, “ds”);
doc.updateFields();
doc.updatePageLayout();
doc.save(“Out.docx”);
} catch (Exception e) {
System.out.println(e.toString());
}
}

}

Hi Mark,


Thanks for the additional information.

First off, I have attached a template Word document and XML file against which Aspose.Words is able to successfully build report using following code:
Document doc = new Document(getMyDir() + “TemplateWithUTF8-correct.doc”);

ReportingEngine engine = new ReportingEngine();

DataSet ds = new DataSet(“items”);
ds.readXml(getMyDir() + “data4-correct.xml”);

engine.buildReport(doc, ds);

doc.save(getMyDir() + “15.8.0-correct.doc”);

Secondly, when adding UTF-8 characters such as  at the beginning of field, Aspose.Words throws following exception:

java.lang.IllegalStateException: An error has been encountered at the end of expression ‘req in Â’. Character ‘Â’ was unexpected at this position.

For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12479. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-12479) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Yes we have verified that the issue is now fixed. Thank You!