oxygenxml / dita-ot-diagrams-plugin

Dynamically convert PlantUML content inside DITA topics to SVG
Apache License 2.0
9 stars 3 forks source link

No diagrams are generated with dita-ot 3.7.2 #5

Closed hcw70 closed 2 years ago

hcw70 commented 2 years ago

No diagrams are generated with dita-ot 3.7.2.

Output area stays empty, but no error message occurs.

Works ok with dita-ot 3.7.0.

raducoravu commented 2 years ago

For what output format is that? Did you add extra plugins in that DITA OT installation?

hcw70 commented 2 years ago

We use a csutom pdf plugin based on https://dita-generator.elovirta.com/ .

raducoravu commented 2 years ago

Can you try with the default PDF plugin? Does this work for the samples bundled with the plugin "https://github.com/oxygenxml/dita-ot-diagrams-plugin/tree/master/com.oxygenxml.diagrams.svg/samples"? If you can reproduce the problem only with your specific DITA content maybe you can attach a small sample DITA project.

hcw70 commented 2 years ago

Just tried with the default pdf plugin. Same problem. Also your samples render empty with the default pdf plugin. Only the mermaid sample shows up.

raducoravu commented 2 years ago

@hcw70 I reproduced the problem, it was not caused by the DITA OT upgrade but probably my recent commits which updated the plantuml library bundled with the plugin: https://github.com/oxygenxml/dita-ot-diagrams-plugin/commit/08ad62cf9a0023a34fe44a2083a520b83ed01dc9 I just uploaded a possible fix for this, can you maybe re-download the plugin from this repository, re-install it and test again?

hcw70 commented 2 years ago

Ok, works again with 868ce533 ! Is this the "final" fix already? So can we use that version?

Thanks for the quick fix for this!

raducoravu commented 2 years ago

I do not have official releases for this plugin, so yes you can use the latest content.

raducoravu commented 2 years ago

Just to give more details about the problem for future reference, the plantuml library creates for the diagram to SVG conversion a DOM document and serializes it using a TransformerFactory. The transformer factory is implemented within the Saxon 10 library and produces lots of empty namespace declarations on all SVG elements which are not the root element. So I just corrected this after the SVG string was created, which is not a very good fix but fixing this at the root would need some more investigating.

hcw70 commented 2 years ago

Thank you for the fast fix! And thanks for sharing the details.