Forum OpenACS Development: Docbook

Collapse
Posted by Lars Pind on
I was trying to see if I could figure out how to transform the docbook XML documents into HTML, but I couldn't. Here's the error I got:
[lars@cph01
/web/openacs-4/packages/acs-core-docs/www/xml/engineering-standards]$
xsltproc -o foo.xml /usr/share/sgml/docbook/docbook-xsl/html/html.xsl
docbook-primer.xml 
docbook-primer.xml:16: error: Entity 'version' not defined
    Overview of OpenACS &version; Documentation
                                        ^
unable to parse docbook-primer.xml
(I was trying to parse the docbook-primer.xml document, just for fun).

I'm guessing that the problem is with the XSL Stylesheets that I got from http://sourceforge.net/projects/docbook/, package docbook-xsl, just like the documentation suggests.

I untar'd them like this:

# cd /usr/share/sgml/docbook
# tar zxf /root/docbook-xsl-1.53.0.tar.gz
# ln -s docbook-xsl-1.53.0/ docbook-xsl
so they're available as /usr/share/sgml/docbook/docbook-xsl.

I'm on Red Hat 7.2, btw.

Is this supposed to work? Am I missing some files or something? Roberto, please help :)

/Lars

Collapse
2: Response to Docbook (response to 1)
Posted by Roberto Mello on
This is one shortcoming with our docbook stuff right now. You either generate everything or nothing (AFAIK, I may be wrong).

The &version; thing was something I added in the toplevel index.xml, so that we could easily change the version that is displayed in all generated pages.

Your stylesheets should work, but they won't generate the HTML with the Alex logo and stuff. If you want that, you have to use our openacs.xsl that is in packages/acs-core-docs/www/xml.

I'm having trouble updating my CVS checkout right now, but I know Vinod added a Makefile that you can just do "make html" or something like that.

Collapse
3: Response to Docbook (response to 1)
Posted by Lars Pind on
Thanks for the quick reply, Roberto.

A little symlinking underneath /usr/share/sgml/docbook, and that works now. Except I get this error:

Writing developers-overview.html for sect1(developers-overview)
Writing packages.html for sect1(packages)
Writing objects.html for sect1(objects)
Error xpath.c:8056: Undefined namespace prefix
Error xpath.c:6062: Invalid operand
make: *** [all] Error 139
Any clue?

/Lars

Collapse
4: Response to Docbook (response to 1)
Posted by Roberto Mello on
Hmm, no idea. Never seen this error. What version of xsltproc do you have installed?
Collapse
5: Response to Docbook (response to 1)
Posted by Lars Pind on
[root@cph01 docbook]# xsltproc -V
Using libxml 20402, libxslt 10001 and libexslt 200
xsltproc was compiled against libxml 20401, libxslt 10001 and libexslt 200
libxslt 10001 was compiled against libxml 20401
libexslt 200 was compiled against libxml 20401
Collapse
6: Response to Docbook (response to 1)
Posted by Lars Pind on
Also:
[root@cph01 docbook]# rpm -qf /usr/bin/xsltproc
libxslt-1.0.1-3
It's the one that came preinstalled with my RH7.2 box.

/Lars

Collapse
7: Response to Docbook (response to 1)
Posted by Roberto Mello on
Hmmm:
<p>
<pre>
rbm@zippy:~$ apt-cache show xsltproc
Package: xsltproc
Priority: optional
Section: text
Installed-Size: 116
Maintainer: Nicolás Lichtmaier <mailto:nick@debian.org>
Architecture: i386
Source: libxslt
Version: 1.0.18-0.1
...
</pre>

<p>Not sure if it's related to the version though.

Collapse
8: Response to Docbook (response to 1)
Posted by Roberto Mello on
Rats, forgot this one:

rbm@zippy:~$ xsltproc -V
Using libxml 20423, libxslt 10018 and libexslt 709
xsltproc was compiled against libxml 20422, libxslt 10018 and libexslt 709
libxslt 10018 was compiled against libxml 20422
libexslt 709 was compiled against libxml 20422
Collapse
9: Response to Docbook (response to 1)
Posted by Peter Marklund on
Thanks Roberto! I was able to make the acs core docs by upgrading the libxml, libxml2 and the libxslt rpms to the latest versions that I could find (I use http://rpmfind.net). What we have now on our RedHat 7.2 server is:

# rpm -qa|grep libxml2

libxml2-devel-2.4.24-1
libxml2-2.4.24-1

# rpm -qa|grep libxml

libxml-1.8.17-6
libxml2-devel-2.4.24-1
perl-libxml-perl-0.07-5
libxml2-2.4.24-1
libxml-devel-1.8.17-6
libxml10-1.0.0-8
perl-libxml-enno-1.02-5

# rpm -qa|grep libxslt

libxslt-progs-1.0.20-2
libxslt-devel-1.0.20-1
libxslt-1.0.20-2

# xsltproc -V

Using libxml 20424, libxslt 10020 and libexslt 711
xsltproc was compiled against libxml 20424, libxslt 10020 and libexslt 711
libxslt 10020 was compiled against libxml 20424
libexslt 711 was compiled against libxml 20424

/Peter

Collapse
10: Re: Docbook (response to 1)
Posted by Luis Armando Arriola on

I'm using Redhat 7.3, when I try to use the "make" to convert the xml files, I get the following error:

cp -u *.png ..
cd .. ; /usr/bin/xsltproc ../../../acs-core-docs/www/xml/openacs.xsl xml/index.xml
Writing requirements-introduction.html for sect1(requirements-introduction)
Writing requirements-overview.html for sect1(requirements-overview)
Error xpath.c:8353: Undefined namespace prefix
xmlXPathCompiledEval: evaluation failed
make: *** [html] Error 139

* I already updated my libraries, this is the output I get:

[beethoven@beethoven xml]$ xsltproc -V
Using libxml 20603, libxslt 10031 and libexslt 721
xsltproc was compiled against libxml 20603, libxslt 10031 and libexslt 721
libxslt 10031 was compiled against libxml 20603
libexslt 721 was compiled against libxml 20603

Does anyone have a clue, of what could be wrong in here? Thanks.

Collapse
11: Re: Docbook (response to 10)
Posted by Andrei Popov on
Can you try and run xsltproc on your .xml doc directly, without make's help?  Or maybe even try to run it on a very simple .xml doc, something like:

<article>
<title>Test article</title>
<para>This is a <emphasis>test</emphasis> article.</para>
</article>

Still same grief?

Collapse
12: Re: Docbook (response to 11)
Posted by Luis Armando Arriola on

I run xsltproc with the single file "simple.xml" like this:

xsltproc -o outputfilename.xml /usr/share/sgml/docbook/docbook-xsl-1.64.1/html/html.xsl prueba.xml

After running xsltproc this is the what "outputfilename.xml" contains:

"<"?xml version="1.0"?">"
Test article
This is a test article.

So here everything seems to go fine, but the with the make command, it still doesn't work

Collapse
13: Re: Docbook (response to 12)
Posted by Andrei Popov on
Can you post the makefile?  It's possible that either your environment or targets are a bit scewed...
Collapse
14: Re: Docbook (response to 13)
Posted by Luis Armando Arriola on
Here are the contents of the Makefile:

# A very simple Makefile to generate the HTML docs

# Paths
XSLTPROC=/usr/bin/xsltproc
HTMLDOC=/usr/bin/htmldoc
XSL=../../../acs-core-docs/www/xml/openacs.xsl

all: html

prelim:
        cp -u *.png ..

html: prelim
        cd .. ; $(XSLTPROC) $(XSL) xml/index.xml

Collapse
15: Re: Docbook (response to 14)
Posted by Andrei Popov on
well, that does look innocent enough.  and what happens if you manually run xsltproc ../../../acs-core-docs/www/xml/openacs.xsl xml/index.xml?  same xpath error or not?

other than suggesting to reinstall libxml -- to ensure that all libs are correct, etc. i can't really suggest more, i am afraid...

Collapse
16: Re: Docbook (response to 15)
Posted by Luis Armando Arriola on
Thanks for your help.

I manually run xsltproc as you suggested and it went fine without the error.

I don't know what conflict had when called from the Makefile.