oxygenxml / dita-ot-diagrams-plugin

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

Bidirectional arrow (<-->) results in "The content of elements must consist of well-formed character data or markup". #3

Closed DivyaRao23 closed 2 years ago

DivyaRao23 commented 2 years ago

I have an XSLT that converts these bidirectional arrows into <-->. Using the encoding I can skip the XML parsing error. However, with encoded <--> the HTML transformation fails to the render SVG image.

If I use unidirectional arrow, it works. ( afsvm-->afs)

Excerpt Dita file

     <foreign outputclass="embed-plant-uml"> 
        @startuml 
        left to right direction
        agent apc as "PC"
        agent afsvm as "VM"
        agent afs as "FS"
        apc--&gt;afsvm 
        afsvm&lt;--&gt;afs
        @enduml </foreign>
raducoravu commented 2 years ago

@DivyaRao23 can you try to re-download and re-install the plugin? I made a change to the "extensions.jar" library. In addition I think you also need to install this extra application: https://plantuml.com/graphviz-dot to have the PlantUML libraries properly be able to create your diagram.

DivyaRao23 commented 2 years ago

@raducoravu, Thank you for the reply.

  1. I downloaded the latest plugin and reinstalled (I did use, dita --install to reinstall after copying the plugin). Still observe the same error.

    [xslt] Error evaluating (fn:parse-xml(...)) in xsl:copy-of/@select on line 21 column 141 of xhtmlSVG.xsl: [xslt] FODC0006: First argument to parse-xml() is not a well-formed and namespace-well-formed XML [xslt] document. XML parser reported: org.xml.sax.SAXParseException; systemId: [xslt] file:/dita-ot-3.6.1/plugins/com.oxygenxml.diagrams.svg/xsl/xhtmlSVG.xsl; lineNumber: 30; columnNumber: 26; The content of elements must consist of well-formed character data or markup.

  2. I have the following version of Dot installed.


java -jar plantuml.jar -testdot
The environment variable GRAPHVIZ_DOT has been set to /usr/local/bin/dot Dot executable is /usr/local/bin/dot Dot version: dot - graphviz version 2.49.0 (20210828.1703) Installation seems OK. File generation OK

raducoravu commented 2 years ago

I'm testing on my side publishing this sample project with the latest plugin installed in DITA OT 3.7 to HTML5 output: flowers.zip and I do not get that SAXParseException error reported in the console. Can you also try with my small sample project? If you cannot reproduce the problem with it, maybe it's another situation and you need to give me a small DITA project to test on my side. If you reproduce the problem also with my sample, this might mean that you may have not updated the plugin's contents.

DivyaRao23 commented 2 years ago

I'm using dita-ot-3.6.1 and my Java version: 17. With the flowers project, I do not get any SAXParseException error reported in the console. However, the SVG image doesn't render completely. image flowers-html5.zip

raducoravu commented 2 years ago

@DivyaRao23 I think I made this work, maybe you can re-download the plugin and try again.

DivyaRao23 commented 2 years ago

@raducoravu , I downloaded the plugin again and reinstalled. It is now working. Thank you so much for the help.

raducoravu commented 2 years ago

@DivyaRao23 I'm glad I could help.