TEIC / oxygen-tei

Automatically exported from code.google.com/p/oxygen-tei
15 stars 6 forks source link

ODD to PDF conversions fail (maybe a Stylesheets issue?) #15

Open martindholmes opened 7 years ago

martindholmes commented 7 years ago

Converting ODDs to PDF in Oxygen currently fails with the bleeding-edge plugin. Try:

TEI/P5/Test/testcorpus.odd

You get: "Effective boolean value is not defined for a sequence of two or more items starting with a boolean" in fo_figures.xsl line 336

Try:

TEI/P5/Test/relatedItem.odd

You get: "A sequence of more than one item is not allowed as the result of function tei:generateRefPrefix() ("relatedItem", "relatedItem")" in teiodds.xsl line 2382.

Could someone running the stable plugin and someone running with the default Oxygen framework in 18.1 please test and report back?

lb42 commented 7 years ago

I think this has been broken for quite a while. Certainly I noticed it before upgrading to the new framework. Line 336 of fo_figures.xsl reads

  <xsl:if test="not(ancestor::tei:table/tei:match(@rend,'tight'))">

which I think should probably be

 <xsl:if test="not(ancestor::tei:table[tei:match(@rend,'tight')])">
lb42 commented 7 years ago

... and yes, I can confirm both these errors are still there with oXygen 18.1 after having uninstalled the bleeding edge framework release (i.e. with no add ons). Definitely a stylesheets issue imho.

lb42 commented 7 years ago

I made the correction suggested above, and now it fails a bit further on, in a way that needs more knowledge of FOP than I have:

System ID: /home/lou/Public/TEI/P5/Exemplars/tei_bare.odd_xslt Scenario: TEI ODD PDF XML file: /home/lou/Public/TEI/P5/Exemplars/tei_bare.odd XSL file: /home/lou/.com.oxygenxml/extensions/v18.1/frameworks/http___teijenkins.hcmc.uvic.ca_job_oxygen_tei_bleeding_lastSuccessfulBuild_artifact_oxygen_tei_updateSite.oxygen/tei/xml/tei/stylesheet/odds/odd2odd.xsl Document type: TEI ODD Engine name: Apache FOP Severity: error Description: The process 'Apache FOP' ended with code: 1. The error was: FATAL - Unsupported TrueType font: No Unicode or Symbol cmap table not present. Aborting FATAL - Unsupported TrueType font: No Unicode or Symbol cmap table not present. Aborting ERROR - net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 1616:-1) ERROR - Exception org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 1616:-1) net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 1616:-1) at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source) at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source) at org.apache.fop.cli.Main.startFOP(Main.java:186) at org.apache.fop.cli.Main.main(Main.java:217) Caused by: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 1616:-1) at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(Unknown Source) at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source) at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:215) ....

Start location: 1616:0

lb42 commented 7 years ago

BTW, converting an ordinary TEI document (e.g. Exemplars/simplePrint.tei) to PDF seems to work fine.

martindholmes commented 7 years ago

This needs some careful attention. I do know FO, so I can take a look at it. I would dearly love to be able to replace the current LaTeX-based build of the Guidelines with an FO version, so this might be a good start into the process.

lb42 commented 7 years ago

Following Alex's observation on another ticket, I got rid of the "fo_figures.xsl" error by changing the line in question to read

 <xsl:if test="not(ancestor::tei:table[1]/tei:match(@rend,'tight'))">

but PDF generation still fails. The problem is now in the FO generation, which fails when processing a <dataRef> that uses @name rather than @key. With the latter, the FO code generated includes a pointer to the TEI data definition; with the former it cannot. But you can't have an empty pointer in FO, so this fails.

lb42 commented 7 years ago

Cf. Stylesheet bug https://github.com/TEIC/Stylesheets/issues/203