OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: DOCBOOK-APPS: Re: import of website.xsl tries to connect tohttp://docbook.sourceforge.net/...

>>>>> "OF" == Fischer, Oliver <plexus@snafu.de> writes:

OF> Hello, I try to transform a XML document written with the
OF> website.dtd into HTML. Unfortunately the XSL file needs an
OF> external resource:

OF> xsltproc --catalogs -o index.html
OF> ../../../data/website/2.3/xsl/website.xsl index.xml

OF> xmlNanoHTTPConnectAttempt: Error connecting to remote host -
OF> Connection refusedxmlNanoHTTPConnectAttempt: Error connecting to
OF> remote host - Connection refusedwarning: failed to load external
OF> entity
OF> "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl";
OF> compilation error: file
OF> ../../../data/website/2.3/xsl/website-common.xsl line 20 element
OF> import xsl:import : unable to load
OF> http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
OF> *** Error code 5

OF> But I am not always at my office, so it can by that I don't have a
OF> internet connection. Is there a way to force it to use the local
OF> installation of these XSL files? Something similar to the CATALOG
OF> files for DTD resolution?

The xsltproc "--catalog" option is for *SGML* catalogs, which you can
use if you want:

Usage: xsltproc [options] stylesheet file [file ...]
--catalogs : use SGML catalogs from $SGML_CATALOG_FILES
             otherwise XML Catalogs starting from 
         file:///etc/xml/catalog are activated by default

But for resolving the <xsl:import> URIs (which is the reason you get
the message), you need to use XML catalogs, documented here:


(I'm pretty sure, but not 100% sure, that SGML catalogs don't work for
<xsl:import> with xsltproc).

All in all, XML catalogs are much superior to SGML catalogs.

As described in the xsltproc usage above, by default, the XML catalogs
in /etc/xml/catalog, is inspected first, I believe you can override
that location by setting the $XML_CATALOG_FILES environment variable.
In any case, add to /etc/xml/catalog (or whatever alternative location
you like), something like this:


This will mean that in the <xsl:import>:


will be translated to the relative path:


PS. The other quick hack, which I don't recommend but if you need
something in a hurry, is to hack the path in the <xsl:import>
website.xsl to be a relative path to the main DocBook XSL
stylesheets.  Try the XML catalog way first, it's better for you in
the long run because you can write portable documents and stylesheet
customization layers.

  Alex Lancaster | Free Software Developer:  savannah.gnu.org, sourceforge.net

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC