kb-dk / MerMEId

Tool for editing MEI header data
Apache License 2.0
20 stars 14 forks source link

XForms problems in non-Docker version – important #177

Open axgeertinger opened 5 years ago

axgeertinger commented 5 years ago

After changing to newer software versions in Fall 2018, certain combinations of Orbeon, Tomcat, and Java seem to be unable to use Xinclude to build the forms. In effect this makes the non-Docker version more or less useless for the time being. We suggest using the Docker version only. A quote from @siglun :

It is possible to select JDK, java compiler and tomcat versions that works (but I cannot say do x, y and z and it will always work). What happens is the following: Orbeon, JDK and tomcat come with sets of libraries, the class loader loads libraries as needed and usually it is able to guess which library it should use. The JSP (you mentioned that you've put it in place inside Orbeon) parses one of the xforms, which then build on demand through XML include. We opted for that since we didn't want to copy the same code over and over again creating a code maintenance hell. The problem arising is that the XML parser provided by Orbeon doesn't support xinclude. There are ways to force the use of a specific parser implementation, but I didn't succeed to do it that way when I ran into this the first time. It involves the one line in the JSP: javax.xml.parsers.DocumentBuilderFactory dfactory = javax.xml.parsers.DocumentBuilderFactory.newInstance(); There is an alternative. It would be to preprocess the forms at build time. I didn't think of that possibility last time I worked on this. One could use a quick and dirty test by the program xmllint. You can enable xinclude by the option --xinclude and save the parsed xml in huge form files that would not need any further preprocessing. If it is successful, one could include this into the ANT build scripts. The advantage would be that we could be independent of Orbeon's XML parser.