Building docbook html from Mac

When I try cmake --build . --target html

I get these kind of errors:

I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
[...]/igraph/build/doc/arpack.xml:7: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
]>
  ^
[...]/igraph/build/doc/arpack.xml:32: parser error : Entity 'mdash' not defined
<title><function>igraph_blas_ddot</function> &mdash;  Dot product of two vectors

The first error seems to find something like docbook 4.3, even though I have 5.1_1 installed with brew. I also installed xmlto, and also docbooks-xsl, to see if that would fix it.

I work on a macOS 10.14.6, and don’t have the rights to install a newer version.

What happens if you try to open http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd from a browser? It seems to work for me and it yields a file with 5703 bytes.

It works for me too, but this file should be installed locally (it is for me).

I can just download it and open it, with either curl or safari.

Cellar/docbook/5.1_1/docbook/xml/4.3/docbookx.dtd also exists and is the same file.

I have the same issue on a linux system (this time with full rights). Almost everything is the same, except now I have docbook version 5.0.1

If I do --skip-validation on the XMLTO, then I’m left with this error:

FAILED: doc/html/stamp /home/daniel/Documents/igraph/build/doc/html/stamp 
cd /home/daniel/Documents/igraph/build/doc && /home/daniel/.nix-profile/bin/xmlto --skip-validation -x /home/daniel/Documents/igraph/doc/gtk-doc.xsl -o html xhtml igraph-docs.xml && /nix/store/kydypcx7vrsxqk8jf4g0gy5lvfm23wz4-cmake-3.24.2/bin/cmake -E copy /home/daniel/Documents/igraph/doc/html/*.css /home/daniel/Documents/igraph/build/doc/html && /nix/store/kydypcx7vrsxqk8jf4g0gy5lvfm23wz4-cmake-3.24.2/bin/cmake -E copy /home/daniel/Documents/igraph/doc/html/*.js /home/daniel/Documents/igraph/build/doc/html && /nix/store/kydypcx7vrsxqk8jf4g0gy5lvfm23wz4-cmake-3.24.2/bin/cmake -E copy /home/daniel/Documents/igraph/doc/html/*.png /home/daniel/Documents/igraph/build/doc/html && /nix/store/kydypcx7vrsxqk8jf4g0gy5lvfm23wz4-cmake-3.24.2/bin/cmake -E touch /home/daniel/Documents/igraph/build/doc/html/stamp
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"
compilation error: file /home/daniel/Documents/igraph/doc/gtk-doc.xsl line 6 element import
xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl
ninja: build stopped: subcommand failed.

Also reported by someone else here:

I also tried adding docbook-xsl-ns and docbook-dtd-43 packages. Doesn’t seem to help.

To build PDFs I’d need xsltproc, xmllint, which I can’t find with my package managers (pacman and nix), and when I try it anyway it takes minutes to get past Resolving includes in DocBook XML source and then fails with

FAILED: doc/igraph-docs.fo /home/daniel/Documents/igraph/build/doc/igraph-docs.fo 
cd /home/daniel/Documents/igraph/build/doc && /usr/bin/xsltproc --output igraph-docs.fo --stringparam paper.type A4 http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl igraph-docs-with-resolved-includes.xml
error : Unknown IO error
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl

which makes sense because xsltproc is not installed, but it does show that it’s always failing with these external entity errors, which seem completely unrelated to external entities. All stackoverflow solutions for
‘xmlto failed to load external entity’ all seem unrelated to external entities and dependent on the project (so no general solution that applies to igraph I think).