-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null pointer exception for figures #2
Comments
After testing with another file turns out that the issue is not related to the references. |
This could be because of many reasons. Can you show a problematic DOCX file? |
It is a part of the code that responsible for figure comments. Do you know Java? You can simply put this part of code into the try-cache block: https://github.com/Vitaliy-1/DOCX2JATS/blob/master/src/doc/transformation/xml/transformerFigures.java#L72-L78 If it helps, do the commit. Tell me if this is problematic for you. Keep in mind that I'm not planning to continue this project as for next several months will be writing a new parser on PHP that can be integrated to OJS. |
Here a link to the article that is causing the issue: Good to see that a integrated solution is on its way, but I need a stopgap for now. For the java bit, Looks like any easy modification I can for the figure comments, but couldn't manage to build a new jar file using javac as I got a build exception: ./docIngestion.java:34: error: package org.apache.tools.ant does not exist Which build settings did you use? |
This is apache ant library. It should be include into the project. |
Ok, I will look at the file |
Any specific instructions on how to build it using ant? |
@Vitaliy-1 So I have been trying to run an ant build but I couldn't find the build.xml file in the directory. Should I make one myself, if so what dependencies should I use? |
Don't recommend to do anything in the |
https://github.com/Vitaliy-1/DOCX2JATS/blob/master/stylesheets/docx/build-from.xml |
@Vitaliy-1 I placed them in eclipse and did get the missing warnings for ant-launcher.jar, ant.jar, and saxon9he.jar. From where do I include them? |
They are all available through maven. For example: https://mvnrepository.com/artifact/net.sf.saxon/saxon9he/9.4.0.4 |
The also can be download manually. if you are not familiar with maven. Saxon, for example, is available here: https://sourceforge.net/projects/saxon/files/ |
It is asking for a pattern and a pattern name, what should I put in here? |
Not sure. And what you are trying to do? |
The main method is inside docIngestion class. If you want to run it from IDE (to check the code before making a jar file) you can specify your input and output file paths here: https://github.com/Vitaliy-1/DOCX2JATS/blob/master/src/doc/transformation/xml/docIngestion.java#L46 and here: https://github.com/Vitaliy-1/DOCX2JATS/blob/master/src/doc/transformation/xml/docIngestion.java#L50 |
@Vitaliy-1 I'm trying to build the project to get the jar file to run the program not run it from the IDE. |
I've only done this before in Eclipse: https://www.cs.utexas.edu/~scottm/cs307/handouts/Eclipse%20Help/jarInEclipse.htm |
@Vitaliy-1 Managed to get the jar, but there seems to be an issue with class path/definitions as it throws this when I try to run it: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
|
Java can't find ant library here. |
The program stops conversion and throws a null pointer exception when using a Harvard references.
Full trace:
BUILD SUCCESSFUL
Total time: 4 seconds
reference list has been found
Exception in thread "main" java.lang.NullPointerException
at doc.transformation.xml.transformerFigures.transformerFiguresImpl(transformerFigures.java:75)
at doc.transformation.xml.docIngestion.ingestionAndTransform(docIngestion.java:122)
at doc.transformation.xml.docIngestion.main(docIngestion.java:52)
The text was updated successfully, but these errors were encountered: