jelovirt / pdf-generator

DITA-OT PDF plug-in generator
https://dita-generator.elovirta.com/
Apache License 2.0
12 stars 5 forks source link

Generation broken: toc-attr_fop.xsl (The system cannot find the file specified) - DITA-OTs v3.4.1, v3.5.4 and v3.6.1 #102

Open Enigma644 opened 1 year ago

Enigma644 commented 1 year ago

transform.topic2fo.main: [pipeline] Loading stylesheet C:\DOTK\dita-ot-3.6.1\plugins\com.me.test\xsl\fo\topic2fo_shell_fop.xsl [pipeline] Error on line 1 column 2976 of topic2fo_shell_fop.xsl: [pipeline] XTSE0165: I/O error reported by XML parser processing [pipeline] file:C:/DOTK/dita-ot-3.6.1/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl: [pipeline] C:\DOTK\dita-ot-3.6.1\plugins\org.dita.pdf2.fop\cfg\fo\attrs\toc-attr_fop.xsl (The system [pipeline] cannot find the file specified) Error: The following error occurred while executing this line: C:\DOTK\dita-ot-3.6.1\plugins\org.dita.pdf2\build.xml:280: java.lang.RuntimeException: Failed to compile stylesheet 'C:\DOTK\dita-ot-3.6.1\plugins\com.me.test\xsl\fo\topic2fo_shell_fop.xsl': I/O error reported by XML parser processing file:C:/DOTK/dita-ot-3.6.1/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl: C:\DOTK\dita-ot-3.6.1\plugins\org.dita.pdf2.fop\cfg\fo\attrs\toc-attr_fop.xsl (The system cannot find the file specified)

This was from creating a test plugin with all the defaults, not changing anything and a new clean DITA OT 3.6.1.

I think there might be a bug with the drop down box to select the DITA-OT version maybe? I did a test creating a plug for version 3.5 and 3.6 and doing a diff on the zip content, everything is exactly the same. If I selet 3.0 then the plugin.xml has transtype in the 3.5, but all the other content is the same and I would have expected some minor changes?

Also tried tested with DITA-OT 3.4.1 and 3.5.4, same error, which make sense as toc-attr_fop.xsl isn't in either of those versions.

Enigma644 commented 1 year ago

Also, simple stuff like switching between A4 and US Letter doesn't seem to be working. Same ZIP content generated for both options.

infotexture commented 1 year ago

See also https://github.com/jelovirt/pdf-generator/issues/99.

chrispy-snps commented 1 year ago

@infotexture - when I run the following commands to build a DITA-OT distribution for develop:

git clone --recurse-submodules https://github.com/dita-ot/dita-ot.git
cd dita-ot
./gradlew
./gradlew dist

it fails as follows:

 Task :pdf FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pdf'.
> The following error occurred while executing this line:
  /.../dita-ot/build/tmp/dist/plugins/org.dita.base/build.xml:28: The following error occurred while executing this line:
  /.../dita-ot/build/tmp/dist/plugins/org.dita.pdf2/build.xml:148: The following error occurred while executing this line:
  /.../dita-ot/build/tmp/dist/plugins/org.dita.pdf2/build.xml:280: java.lang.RuntimeException: Failed to compile stylesheet 'file:/tmp/dita-ot/1691930059312/com.elovirta.pdf-1210629051/xsl/fo/topic2fo_shell.xsl': I/O error reported by XML parser processing file:/.../dita-ot/build/tmp/dist/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl

Can you reproduce this?

infotexture commented 1 year ago

Can you reproduce this?

@chrispy-snps Yes. 😥

When I run the distribution from a fresh worktree built from dita-ot/dita-ot@f1750d5, I get the same error, so #99 may not be invalid after all. (Links there point to places where the code references the missing toc-attr_fop.xsl file.)

Not sure if @jelovirt will want to reopen #99. 🤔

While the error suggests these 2 issues may be related, I'm not sure this one is a duplicate of #99, as @Enigma644 seems to be using the web app at https://dita-generator.elovirta.com to generate plug-ins and IIRC, that code is not used in the DITA-OT distribution build process.