catalog.xml for docbook

S

Simon Strandgaard

I am trying to understand how to create a 'catalog.xml'
file for my docbook-xml documents. If I understand
correct a local catalog.xml file can both avoid hardcoding
in makefiles (portability), plus speed up if the
stylesheet+dtds is located on the local machine.

Question #1:
How do I create a catagory.xml file, which works?


I tried follow the guide at
http://www.sagehill.net/docbookxsl/Catalogs.html
But cannot seems to get thier code working.

Question #2:
Can anyone help me hunt down the problem with the following
relative simple catalog.xml ?

Question #3:
I am worried that I do this completely wrong, how do
you deal with 'catalog.xml' ?

Please help (thanks in advance).

--
Simon Strandgaard



box% gmake
xsltproc --output index.html docbook.xsl main.xml
warning: failed to load external entity "docbook.xsl"
cannot parse docbook.xsl
gmake: *** [xhtml] Fejl 4
box%

** Makefile **

box% expand -t4 Makefile
XML_CATALOG_FILES=catalog.xml
XML_DEBUG_CATALOG=4

xhtml:
xsltproc --output index.html docbook.xsl main.xml
box%

** main.xml **

box% expand -t4 main.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article
PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
]>
<article>
<articleinfo>
<title>Test</title>
<author>
<firstname>Simon</firstname>
<surname>Strandgaard</surname>
</author>
</articleinfo>
<section><title>Title</title>
<para>placeholder.</para>
</section>
</article>
box%

** catalog.xml **

on my FreeBSD machine, the 'docbookx.dtd' is located at:
/usr/local/share/xml/docbook/4.2/docbookx.dtd

the stylesheet which I want to use is located here:
/usr/local/share/xsl/docbook/xhtml/docbook.xsl

Question #4:
Have I entered this information correct into catalog.xml ?


box% expand -t4 catalog.xml
<?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:eek:asis:names:tc:entity:xmlns:xml:catalog">

<!-- DTD files installed under /usr/local/share/xml -->
<group xml:base="file:///usr/local/share/xml/" >
<!-- Resolve DTD URL system ID to local file -->
<rewriteSystem
systemIdStartString="http://www.oasis-open.org/docbook/xml/4.2/"
rewritePrefix="docbook/4.2/" />
<!-- Resolve DTD PUBLIC identifiers -->
<nextCatalog catalog="docbook/4.2/catalog.xml" />
<!-- To resolve simple DTD SYSTEM identifiers. -->
<!-- Note: this does not work with Java resolver -->
<!-- classes in Saxon or Xalan -->
<system
systemId="docbook.dtd"
uri="docbook/4.2/docbookx.dtd" />
</group>

<!-- stylesheet files installed under /usr/local/share/xsl -->
<group xml:base="file:///usr/local/share/xsl/" >
<!-- Resolve stylesheet URL to local file -->
<rewriteURI
uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
rewritePrefix="docbook/" />
<!-- To resolve short stylesheet references -->
<uri
name="docbook.xsl"
uri="docbook/xhtml/docbook.xsl" />
</group>

</catalog>
box%
 
S

Simon Strandgaard

On Wed, 20 Aug 2003 23:03:04 +0200, Simon Strandgaard wrote:
[snip]
box% gmake
xsltproc --output index.html docbook.xsl main.xml
warning: failed to load external entity "docbook.xsl"
cannot parse docbook.xsl
gmake: *** [xhtml] Fejl 4
box%

** Makefile **

box% expand -t4 Makefile
XML_CATALOG_FILES=catalog.xml
XML_DEBUG_CATALOG=4

xhtml:
xsltproc --output index.html docbook.xsl main.xml
[snip]

Silly me.. I took me a while to figure out that
specifying XML_CATALOG_FILES in the top of the makefile
is not equal to setting an environment variable.

Now I have 'setenv XML_CATALOG_FILES catalog.xml' in my .tcshrc
 
S

Simon Strandgaard

Silly me.. I took me a while to figure out that
specifying XML_CATALOG_FILES in the top of the makefile
is not equal to setting an environment variable.

Now I have 'setenv XML_CATALOG_FILES catalog.xml' in my .tcshrc

OK.. I got 'catalog.xml' working. Many problems, which actually were
quite simple, thus I have written a mini-howto on how you can get
catalog.xml working in a hurry (15 minutes).

Please review and comment on it.

http://aeditor.rubyforge.org/mini_docbook.html

Especialy the troubleshooting section is what I feel other
tutorials/manuals is missing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top