Skip to content

Instantly share code, notes, and snippets.

@t-mart
Created December 4, 2018 16:41
Show Gist options
  • Save t-mart/87c7b2f6eccead867ed524e2b6ca22c8 to your computer and use it in GitHub Desktop.
Save t-mart/87c7b2f6eccead867ed524e2b6ca22c8 to your computer and use it in GitHub Desktop.
xmlto does not validate xmlto: Fix document syntax or use --skip-validation option I/O error : Attempt to load network entity dtd warning: failed to load external entity D DocBook XML V4.5//EN"

Problem

When compiling git from source, I often run into this problem:

% make prefix=$HOME all doc info
    SUBDIR git-gui
    SUBDIR gitk-git
    SUBDIR templates
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C Documentation all
    GEN doc.dep
    SUBDIR ../
make[2]: `GIT-VERSION-FILE' is up to date.
    SUBDIR ../
make[2]: `GIT-VERSION-FILE' is up to date.
    XMLTO git-add.1
xmlto: /Users/tmartin/src/git-2.19.2/Documentation/git-add.xml does not validate (status 3)
xmlto: Fix document syntax or use --skip-validation option
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
/Users/tmartin/src/git-2.19.2/Documentation/git-add.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
                                                                               ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
validity error : Could not load the external subset "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
Document /Users/tmartin/src/git-2.19.2/Documentation/git-add.xml does not validate
make[1]: *** [git-add.1] Error 13
make: *** [doc] Error 2

Solution

As mentioned by https://stackoverflow.com/a/18028336/235992, do the following:

brew install asciidoc
brew install xmlto
brew install docbook   
brew install docbook-xsl
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog
make prefix=$HOME all doc info  # resume your command...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment