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

Validation failed: no DTD found ! #2

Open
jaynel opened this issue Dec 17, 2016 · 9 comments
Open

Validation failed: no DTD found ! #2

jaynel opened this issue Dec 17, 2016 · 9 comments

Comments

@jaynel
Copy link

jaynel commented Dec 17, 2016

I'm certain this is some sort of installation error on my part, but I'm having trouble getting a document to compile on my Mac OS X 10.11.6 laptop. Here's the output:

$ make asciidoc-guide
 GEN    distclean-asciidoc-guide
a2x -v -f pdf doc/src/guide/book.asciidoc && mv doc/src/guide/book.pdf doc/guide.pdf
a2x: args: ['--dblatex-opts', '-P latex.output.revhistory=0 -P doc.publisher.show=0 -P index.numbered=0', '--xsltproc-opts', '--stringparam use.id.as.filename 1', '-d', 'book', '--attribute', 'tabsize=4', '-v', '-f', 'pdf', 'doc/src/guide/book.asciidoc']
a2x: resource files: []
a2x: resource directories: ['/usr/local/etc/asciidoc/images', '/usr/local/etc/asciidoc/stylesheets']
a2x: executing: "/usr/local/bin/asciidoc.py" --backend docbook -a "a2x-format=pdf"  --doctype book --attribute "tabsize=4" --verbose  --out-file "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml" "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.asciidoc"

asciidoc: reading: /usr/local/etc/asciidoc/asciidoc.conf
asciidoc: reading: /Users/jay/GitPeg/Tokenizer/doc/src/guide/book.asciidoc
asciidoc: reading: /usr/local/etc/asciidoc/docbook45.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/code/code-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/graphviz/graphviz-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/latex/latex-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/music/music-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/source/source-highlight-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/lang-en.conf
asciidoc: writing: /Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml
asciidoc: include: /Users/jay/GitPeg/Tokenizer/doc/src/guide/overview.asciidoc
asciidoc: book.asciidoc: line 8: reading: /Users/jay/GitPeg/Tokenizer/doc/src/guide/overview.asciidoc

a2x: executing: "xmllint" --nonet --noout --valid "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml"

/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.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"
                                                                               ^
/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml:6: validity error : Validation failed: no DTD found !
<book lang="en">
               ^

a2x: ERROR: "xmllint" --nonet --noout --valid "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml" returned non-zero exit status 4
make: *** [erlang.mk:5238: asciidoc-guide] Error 1

I've been trying to install according to this http://stackoverflow.com/questions/13519203/git-compilingdocumentation-git-add-xml-does-not-validate

I don't have brew or fink, so I installed http://www.linuxfromscratch.org/blfs/view/cvs/pst/xmlto.html by hand doing the steps for docbook-xml-4.5, docbook-xsl-1.79.1, and libxslt-1.1.29. I built dblatex-0.3.9 and asciidoc-8.6.9 from source.

I installed the catalog stuff in /usr/local/etc/xml/catalog and /usr/local/etc/xml/docbook, updated the $XML_CATALOG_FILES env. Running 'xmllint --help' it said it looks in /etc/xml/catalog by default so I made that a symbolic link to my /usr/local/etc/xml/catalog just in case.

$ ls -l /etc/xml/catalog
lrwxr-xr-x  1 root  wheel  26 Dec 17 08:24 /etc/xml/catalog -> /usr/local/etc/xml/catalog

$ file !$
file /etc/xml/catalog
/etc/xml/catalog: XML  document text

$ cat !$
cat /etc/xml/catalog
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///usr/local/etc/xml/docbook"/>
</catalog>

$ cat /usr/local/etc/xml/docbook
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.5" rewritePrefix="file:///usr/local/etc/xml/docbook/xml-dtd-4.5"/>
</catalog>

Any clues what else I need to do?

@jaynel
Copy link
Author

jaynel commented Dec 17, 2016

Seems I don't have docbook-xsl installed properly. Where do you put that directory? Is it invoked by something?

I put it in /usr/local/etc/xml/docbook-xsl-1.79.1 then tried to run ./install.sh from inside that directory:

$ ./install.sh 

NOTE: For non-interactive installs/uninstalls, use --batch


NOTE: There is no CLASSPATH variable set in your environment.
      No attempt was made to find a CatalogManager.properties
      file.  Using /Users/jay/.resolver/CatalogManager.properties instead

Create /Users/jay/.resolver/CatalogManager.properties file? [Yes] Y

cp: /usr/local/etc/xml/docbook-xsl-1.79.1/.CatalogManager.properties.example: No such file or directory

@essen
Copy link
Member

essen commented Dec 17, 2016

The guide is still generated by Asciidoc (Python). I am hoping to have a good HTML/PDF output from Asciideck (Erlang) in a couple weeks and just use that from that point onward. Much less dependencies.

Asciidoc depends on a lot of stuff and I never installed from source. It does require docbook-xsl. On my system (Arch Linux) they are at /usr/share/xml/docbook/xsl-stylesheets-1.79.1. I don't know where OSX puts them. On the test OSX machine I used Homebrew to install Asciidoc, and I have no idea where the files are. :-)

@jaynel
Copy link
Author

jaynel commented Dec 17, 2016

I had to use asciideck as a dependency in erlang.mk Makefile to get it running. You are saying that the dependency will use a different generation method in a couple weeks and maybe all this docbook-xsl stuff will go away?

@essen
Copy link
Member

essen commented Dec 17, 2016

Yes the idea is to have a path to HTML/PDF that doesn't use DocBook by default. I will spend the week between Xmas and New Year exclusively on that. I've probably put the Asciideck dependency requirement a bit early all things considered.

@jaynel
Copy link
Author

jaynel commented Dec 17, 2016

Ok, thanks. Will focus on writing my docs over the holidays. Hopefully I can compile them in the New Year. It's looking to be a very useful addition to erlang.mk!

@essen
Copy link
Member

essen commented Dec 17, 2016

I'll ping here when I've made (some) progress. It'll be useful to see what you use from Asciidoc, it's a big format and I won't have time to implement every little things in one week. :-)

@jaynel
Copy link
Author

jaynel commented Dec 17, 2016

I just need basic outline include (overview like you do), paragraphs, source code quotes, numbered and bullet lists, maybe tables, and embedded images. The Notes, Warnings, etc would be embellishments, but don't need them necessarily. Later on I can add Table of Contents, page numbering, etc, just need to get some documentation in place right now that is organized.

@essen
Copy link
Member

essen commented Dec 17, 2016

Don't let me stop you from using anything. I'll add as necessary. Most block constructs are easy to add, so it's not a problem. I'm actually looking forward to get documents that contain things I don't use myself.

@essen
Copy link
Member

essen commented Jun 13, 2018

I've finished the rewrite of this project. I will soon update Erlang.mk to use it for generating the guide, but it'll take a bit more time. See https://ninenines.eu/articles/asciideck/ for the announcement.

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

2 participants