As I said, when I did the first half (the catalog), xmllint started
working from the command line on the xml output from the aborted a2x
command (you could at least test that), but I was not able to get
xmllint working from within a2x until I also installed the DocBook XSL
stylesheets and got the .resolver set up. It is important to do
the .resolver stuff *after* creating the catalog, because otherwise
the resolver script won't see it. m.

On Nov 1, 11:46 am, gerd <[email protected]> wrote:
> Hi Mat,
>
> I followed your instructions, but unfortunately I still run into the
> same error and the command a2x -f pdf is still returning the same
> error:
>
> gerdMac:tmp gerd$ a2x -f pdf week4_dq2.txt
> a2x: ERROR: xmllint --nonet --noout --valid /Users/gerd/Documents/tmp/
> week4_dq2.xml returned non-zero exit status 4
> gerdMac:tmp gerd$
>
> The --verbose option is showing, that still no DTD is found.
>
> gerdMac:tmp gerd$ a2x -f pdf --verbose week4_dq2.txt
> a2x: args: ['-f', 'pdf', '--verbose', 'week4_dq2.txt']
> a2x: executing: /usr/local/Cellar/asciidoc/8.6.1/bin/asciidoc.py --
> backend docbook  --verbose  --out-file /Users/gerd/Documents/tmp/
> week4_dq2.xml /Users/gerd/Documents/tmp/week4_dq2.txt
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/
> asciidoc.conf
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/
> docbook.conf
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/
> filters/code/code-filter.conf
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/
> filters/graphviz/graphviz-filter.conf
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/
> filters/music/music-filter.conf
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/
> filters/source/source-highlight-filter.conf
> asciidoc: reading: /Users/gerd/Documents/tmp/week4_dq2.txt
> asciidoc: writing: /Users/gerd/Documents/tmp/week4_dq2.xml
> asciidoc: reading: /usr/local/Cellar/asciidoc/8.6.1/etc/asciidoc/lang-
> en.conf
> a2x: executing: xmllint --nonet --noout --valid /Users/gerd/Documents/
> tmp/week4_dq2.xml
> I/O error : Attempt to load network 
> entityhttp://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
> /Users/gerd/Documents/tmp/week4_dq2.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/gerd/Documents/tmp/week4_dq2.xml:6: validity error : Validation
> failed: no DTD found !
> <article lang="en">
>                   ^
> a2x: ERROR: xmllint --nonet --noout --valid /Users/gerd/Documents/tmp/
> week4_dq2.xml returned non-zero exit status 4
> gerdMac:tmp gerd$
>
> I have placed the docbookx.dtd in the .asciidoc folder and cat catalog
> in the /etc/xml/ folder is saying:
>
> gerdMac:xml gerd$ cat 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">
>   <public publicId="-//OASIS//DTD DocBook XML V4.5// EN" uri="file:///
> Users/gerd/.asciidoc/docbookx.dtd"/>
>   <public publicId="-//OASIS//DTD DocBook XML V4.5// EN" uri="file:///
> Users/gerd/.asciidoc/docbookx.dtd"/>
>   <system systemId="http://www.oasis-open.org/docbook/ xml/4.5/
> docbookx.dtd" uri="file:///Users/gerd/.asciidoc/docbookx.dtd"/>
> </catalog>
> gerdMac:xml gerd$
>
> can you give me a hint. I'm unsure placing the docbookx.dtd under /usr/
> local/Cellar/asciidoc/8.6.1/etc/asciidoc/ which is the folder where
> asciidoc was installed. I installed is using Homebrew.
>
> Cheers
> Gerd
>
> On Oct 30, 7:40 am, mattn <[email protected]> wrote:
>
>
>
> > HOW I GOT a2x WORKING ON MAC OS X
>
> > I went tohttp://www.docbook.org/schemas/4x.htmlanddownloaded the
> > DocBook 4.5 XML DTD.
>
> > I unzipped it. Now I had a folder docbook-xml-4.5. I had to think of a
> > place to put it; in the end I created ~/.asciidoc and put it in there,
> > because that's also where an a2x.conf file would go if I were using
> > one.
>
> > Now I needed to point at this DTD through an xml catalog. So I
> > created /etc/xml, and inside that I tried to create /etc/xml/catalog
> > like this:
>
> > sudo xmlcatalog --create > /etc/xml/catalog
>
> > This failed, so I had to run as root; then I was able to create the
> > catalog.
>
> > Now I added entries into this catalog, pointing the public and system
> > IDs at the DTD:
>
> > sudo xmlcatalog --noout -add public "-//OASIS//DTD DocBook XML V4.5//
> > EN" "file:///Users/mattleopard/.asciidoc/docbook-xml-4.5/
> > docbookx.dtd" /etc/xml/catalog
> > sudo xmlcatalog --noout -add system "http://www.oasis-open.org/docbook/
> > xml/4.5/docbookx.dtd" "file:///Users/mattleopard/.asciidoc/docbook-
> > xml-4.5/docbookx.dtd" /etc/xml/catalog
>
> > The result is as follows:
>
> > 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">
> >   <public publicId="-//OASIS//DTD DocBook XML V4.5//EN" uri="file:///
> > Users/mattleopard/.asciidoc/docbook-xml-4.5/docbookx.dtd"/>
> >   <system systemId="http://www.oasis-open.org/docbook/xml/4.5/
> > docbookx.dtd" uri="file:///Users/mattleopard/.asciidoc/docbook-xml-4.5/
> > docbookx.dtd"/>
> > </catalog>
>
> > So far so good, and the result is that xmllint now worked for me on
> > asciidoc's docbook xml output (because it was able to find the DTD
> > locally) - but not under a2x.
>
> > Okay, so then I went tohttp://sourceforge.net/projects/docbook/to
> > get the stylesheets. This is where I made my mistake: the stylesheets
> > they are advertising are not the ones you want. They are advertising
> > some xsl-ns stylesheets, but asciidoc assumes the xsl stylesheets. So
> > it wasn't until downloading the wrong thing, realizing that this was
> > the wrong thing, and then some serious hunting around that I finally
> > found this:
>
> >http://sourceforge.net/projects/docbook/files/docbook-xsl/1.76.0/docb...
>
> > I downloaded that and unzipped it. This gave a folder docbook-
> > xsl-1.76.0, and I put that into ~/.asciidoc. Then I cd'd into that
> > folder and followed the instructions there, running this command:
>
> > ./install.sh
>
> > ...and saying Y to all the questions posed. This modified
> > my .bash_profile and I later had to go in and clean it up a bit (it
> > had assumed my .bash_profile ended with a linefeed, and it didn't).
> > However, it also did something else, which was very important: it set
> > up a ~/.resolver folder and, noticing that /etc/xml/catalog existed,
> > it configured the CatalogManager.properties file there to point to it,
> > so that now the file contained this line:
>
> > catalogs=/Users/mattleopard/.asciidoc/docbook-xsl-1.76.0/catalog.xml;/
> > etc/xml/catalog
>
> > Notice that this points both to the catalog in the stylesheets folder
> > and my /etc/xml/catalog file. It was this that caused xmllint to start
> > working inside a2x, and it also caused xsltproc to work because now it
> > could find the stylesheets.

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to