Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors + suggestion about Docker #108

Open
mkibp opened this issue Dec 10, 2024 · 3 comments
Open

Errors + suggestion about Docker #108

mkibp opened this issue Dec 10, 2024 · 3 comments
Assignees

Comments

@mkibp
Copy link

mkibp commented Dec 10, 2024

Hello, after cloning the repo recursively as in the README and trying to run, I got the issue:

[main] INFO com.xmlcalabash.runtime.XAtomicStep - xpl/docx2tex.xpl:205:38:No custom-font-maps loaded.
Error on line 1 column 1 of conf.csv:
  SXXP0003   Error reported by XML parser: Content is not allowed in prolog.: Content is not
  allowed in prolog.
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - xproc-util/load/xpl/load.xpl:0:load-error:Could not load file:///home/.../docx2tex/conf/conf.csv (file:/home/.../docx2tex/xproc-util/load/xpl/load.xpl) dtd-validate>
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - xproc-util/load/xpl/load.xpl:0:load-error:Could not load file:///home/.../docx2tex/conf/conf.csv (file:/home/.../docx2tex/xproc-util/load/xpl/load.xpl) dtd-validate>
Warning at xsl:function on line 229 column 6 of sym.xsl:
   The option xsl:function/@saxon:memo-function is ignored because it requires a Saxon-PE license
Error at char 63 in xsl:variable/@select on line 3462 column 56 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Error at char 63 in xsl:variable/@select on line 3482 column 55 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Warning at xsl:output on line 88 column 7 of main.xsl:
  XTSE0090  Unrecognized attribute in Saxon namespace: saxon:suppress-indentation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep -     cause: Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep -     cause: Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.drivers.Main - Pipeline failed: Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.drivers.Main - Underlying exception: Errors were reported during stylesheet compilation

For a good measure I tried editing conf/conf.csv and even removing it, to no avail:

[main] INFO com.xmlcalabash.runtime.XAtomicStep - xpl/docx2tex.xpl:205:38:No custom-font-maps loaded.
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - xproc-util/load/xpl/load.xpl:0:load-error:Could not load file:///home/.../docx2tex/conf/conf.csv (file:/home/.../docx2tex/xproc-util/load/xpl/load.xpl) dtd-validate>
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - xproc-util/load/xpl/load.xpl:0:load-error:Could not load file:///home/.../docx2tex/conf/conf.csv (file:/home/.../docx2tex/xproc-util/load/xpl/load.xpl) dtd-validate>
Warning at xsl:function on line 229 column 6 of sym.xsl:
   The option xsl:function/@saxon:memo-function is ignored because it requires a Saxon-PE license
Error at char 63 in xsl:variable/@select on line 3462 column 56 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Error at char 63 in xsl:variable/@select on line 3482 column 55 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Warning at xsl:output on line 88 column 7 of main.xsl:
  XTSE0090  Unrecognized attribute in Saxon namespace: saxon:suppress-indentation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep -     cause: Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.runtime.XAtomicStep -     cause: Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.drivers.Main - Pipeline failed: Errors were reported during stylesheet compilation
[main] ERROR com.xmlcalabash.drivers.Main - Underlying exception: Errors were reported during stylesheet compilation

(I am on latest Fedora)

$ java --version
openjdk 21.0.5 2024-10-15
OpenJDK Runtime Environment (Red_Hat-21.0.5.0.11-1) (build 21.0.5+11)
OpenJDK 64-Bit Server VM (Red_Hat-21.0.5.0.11-1) (build 21.0.5+11, mixed mode, sharing)

With that said, running sudo alternatives --config java and changing it to openjdk-17 did not help either.

My little plea for consideration here would be: could you consider creating (and pushing to GitHub Container Registry?) a Docker container that would allow one-shot running of this with a known-working version? It's a common strategy for tooling with tricky dependencies and it would help tremendously.

Imagine running it then simply something like this:

docker run -it --rm -v ${PWD}:/work ghcr.io/transpect/docx2tex ./d2t /work/mydocx.docx

(--rm so that the container is ended immediately after exit and doesn't linger around)

EDIT: But it seems running docx2tex-1.9-release.zip instead works 👍 so it's only the master that's broken right now

@gimsieke
Copy link
Contributor

You didn’t say how you were trying to invoke it. Try -c /path/to/conf.xml instead of conf.csv. The csv configuration is 9 years old, it doesn’t seem to be maintained any more, and apparently the conversion pipeline now expects an XML configuration file.

Regarding docker: We might eventually provide a container.

@mkibp
Copy link
Author

mkibp commented Dec 10, 2024

Yeah I tried that before too,

./d2t -c /home/.../docx2tex_git/conf/conf.xml ../test.docx

That also errors out, but with different errors:

[main] INFO com.xmlcalabash.runtime.XAtomicStep - xpl/docx2tex.xpl:205:38:No custom-font-maps loaded.
[main] INFO com.xmlcalabash.runtime.XAtomicStep - xml2tex/xpl/load-config.xpl:60:15:params: coll-xsl yes || elt-name:  xsl:param || att-name:  name
[main] INFO com.xmlcalabash.runtime.XAtomicStep - xml2tex/xpl/load-config.xpl:60:15:params: coll-xsl yes || elt-name:  xsl:key || att-name:  name
[main] INFO com.xmlcalabash.runtime.XAtomicStep - xml2tex/xpl/load-config.xpl:60:15:params: coll-xsl yes || elt-name:  xsl:variable || att-name:  name
[main] INFO com.xmlcalabash.runtime.XAtomicStep - xml2tex/xpl/load-config.xpl:60:15:params: coll-xsl yes || elt-name:  xsl:template || att-name:  name
[main] INFO com.xmlcalabash.runtime.XAtomicStep - xml2tex/xpl/load-config.xpl:60:15:params: coll-xsl yes || elt-name:  xsl:template || att-name:  match
[main] INFO com.xmlcalabash.runtime.XAtomicStep - xml2tex/xpl/load-config.xpl:60:15:params: coll-xsl yes || elt-name:  xsl:function || att-name:  name
Message: Mode: insert-xpath
Warning at xsl:function on line 229 column 6 of sym.xsl:
   The option xsl:function/@saxon:memo-function is ignored because it requires a Saxon-PE license
Error at char 63 in xsl:variable/@select on line 3462 column 56 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Error at char 63 in xsl:variable/@select on line 3482 column 55 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Warning at xsl:output on line 88 column 7 of main.xsl:
  XTSE0090  Unrecognized attribute in Saxon namespace: saxon:suppress-indentation
Message: Errors were reported during stylesheet compilation
Message: [FATAL ERROR]: XSLT mode 'insert-xpath' failed due to conversion errors. Recovering from errors and proceeding with original input. 
Message: Mode: insert-doc-defaults
Error at char 63 in xsl:variable/@select on line 3462 column 56 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Error at char 63 in xsl:variable/@select on line 3482 column 55 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Message: Errors were reported during stylesheet compilation
Message: [FATAL ERROR]: XSLT mode 'insert-doc-defaults' failed due to conversion errors. Recovering from errors and proceeding with original input. 
Message: Mode: docx2hub:resolve-tblBorders
Error at char 63 in xsl:variable/@select on line 3462 column 56 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Error at char 63 in xsl:variable/@select on line 3482 column 55 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Message: Errors were reported during stylesheet compilation
Message: [FATAL ERROR]: XSLT mode 'docx2hub:resolve-tblBorders' failed due to conversion errors. Recovering from errors and proceeding with original input. 
Message: Mode: docx2hub:add-props
Error at char 63 in xsl:variable/@select on line 3462 column 56 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Error at char 63 in xsl:variable/@select on line 3482 column 55 of omml2mml.xsl:
  XPST0008  Variable css:known-color-keywords has not been declared (or its declaration is
  not in scope)
Message: Errors were reported during stylesheet compilation
Message: [FATAL ERROR]: XSLT mode 'docx2hub:add-props' failed due to conversion errors. Recovering from errors and proceeding with original input. 
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - step tr:xslt-mode named props2atts at file:/home/.../docx2tex_git/docx2hub/xpl/docx2hub.xpl:408:docx2hub/xpl/docx2hub.xpl:408:72:err:XD0008:More than one document in context for parameter 'debug'
[main] ERROR com.xmlcalabash.runtime.XAtomicStep - step tr:xslt-mode named props2atts at file:/home/.../docx2tex_git/docx2hub/xpl/docx2hub.xpl:408:docx2hub/xpl/docx2hub.xpl:408:72:err:XD0008:More than one document in context for parameter 'debug'
[main] ERROR com.xmlcalabash.drivers.Main - It is a dynamic error if a document sequence appears where a document to be used as the context node is expected.

To my layman eyes it doesn't seem like the main error is the config files, but rather the updated deps/submodules

@mkraetke
Copy link
Member

The error has been fixed. Please pull the most recent version of the xslt-util submodule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants