By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,307 Members | 2,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,307 IT Pros & Developers. It's quick & easy.

catalog.xml for docbook

P: n/a
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:oasis: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%
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

--
Simon Strandgaard

Jul 20 '05 #2

P: n/a
On Fri, 22 Aug 2003 16:05:39 +0200, Simon Strandgaard wrote:
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.

--
Simon Strandgaard
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.