I’m new to Aspose.Words for Java and I need to generate a report from an XML file (I started from the MustacheTemplateSyntax example).
The syntax to use foreach tag and to get access to xml nodes is pretty clear, but I also need to use conditionals (IF statements) and use expressions to test if a field in the XML is set or not, if a String field starts with some prefix, …
Is there any online documentation about the tags I can use with Mustache Syntax, how to build expressions, etc?
I tried to load the DataSet object with the readXml parameter but I can’t find this method…
I’m working on the aspose-words-14.12.0-jdk15.jar, because we are using a very old JBoss version on a java jdk15.
How could I load the xml on the DataSet with this 14.12 version?
Thanks for your inquiry. Unfortunately, this feature (DataSet.readXML) is not available in older version of Aspose.Words. If you want to use this feature, please use latest version of Aspose.Words for Java 15.8.0.
We changed our initial idea and we are now trying to load the data to the report engine by using a Java object instead of an xml file using “aspose-words-14.12.0-jdk15.jar”, but it’s failing when running the buildReport method.
public class LinqEngineTest {
public static void main(String[] args) throws Exception {
String dataDir = "C:/path/to/the/report/";
Document doc = new Document(dataDir + "EscrituraTemplate.doc");
Sender sender = new Sender("LINQ Reporting Engine", "Hello World");
ReportingEngine engine = new ReportingEngine();
engine.buildReport(doc, sender, "s");
doc.save(dataDir + "out.docx");
}
}
The exception we are getting:
Exception in thread "main" java.lang.NoClassDefFoundError: [Lorg/objectweb/asm/Type;
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at asposewobfuscated.zzWJ.zzY(Unknown Source)
at asposewobfuscated.zzWJ.(Unknown Source)
at asposewobfuscated.zzWK.zzX(Unknown Source)
at asposewobfuscated.zzWH.zzQ(Unknown Source)
at asposewobfuscated.zzWH.zzZ(Unknown Source)
at asposewobfuscated.zzWH.zzY(Unknown Source)
at asposewobfuscated.zzWH.zzZ(Unknown Source)
at asposewobfuscated.zzO7.zzY(Unknown Source)
at asposewobfuscated.zzY5.zzZ(Unknown Source)
at asposewobfuscated.zzY5.zzXw(Unknown Source)
at asposewobfuscated.zzY5.zzXx(Unknown Source)
at asposewobfuscated.zzY5.zzXy(Unknown Source)
at asposewobfuscated.zzY5.zzXz(Unknown Source)
at asposewobfuscated.zzY5.zzXA(Unknown Source)
at asposewobfuscated.zzY5.zzXB(Unknown Source)
at asposewobfuscated.zzY5.zzXC(Unknown Source)
at asposewobfuscated.zzY5.zzXD(Unknown Source)
at asposewobfuscated.zzY5.zzXE(Unknown Source)
at asposewobfuscated.zzY5.zzXF(Unknown Source)
at asposewobfuscated.zzY5.zzXG(Unknown Source)
at asposewobfuscated.zzY5.zzXH(Unknown Source)
at asposewobfuscated.zzY5.zzXI(Unknown Source)
at asposewobfuscated.zzY5.zzXJ(Unknown Source)
at asposewobfuscated.zzY5.zzXM(Unknown Source)
at asposewobfuscated.zzTP.zzZ(Unknown Source)
at asposewobfuscated.zzN7.zzKr(Unknown Source)
at asposewobfuscated.zzX5.zzW4(Unknown Source)
at asposewobfuscated.zzX5.parseTag(Unknown Source)
at asposewobfuscated.zzX5.zzW5(Unknown Source)
at asposewobfuscated.zzN7.zzZ(Unknown Source)
at asposewobfuscated.zzH1.zzZ(Unknown Source)
at asposewobfuscated.zzH1.zzZ(Unknown Source)
at com.aspose.words.ReportingEngine.buildReport(Unknown Source)
at org.notariado.ancert.asposeTest.linq.LinqEngineTest.main(LinqEngineTest.java:17)
I was wondering if that error may be caused by a missing library but I read somewhere that Aspose Words for Java doesn’t have any dependencies…
Thanks for your inquiry. After an initial test with latest version of Aspose.Words, I was unable to reproduce this issue on my side. So, please upgrade to the latest version of Aspose.Words for Java i.e. 15.8.0 from here: https://releases.aspose.com/words/java
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.