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] | [List Home]

Subject: Re: [docbook-apps] Problem with XML catalogs and Saxon


thank you, sir.
I was struggling to solve the problem using all the suggestions I have found in the Internet. You are absolutely right, you never used that kind of syntax to set the "catalogs" parameter.

I am a bit confused after reading documentation for the Apache XML catalog resolver. Hence, you can see this chaotic attempt to find a solution. I will try your suggestions ASAP and will come back with the results, if I am successful.

Thanks again,


On 1/18/06, Bob Stayton <bobs@sagehill.net> wrote:
Your catalog.xml file is not being loaded because of the syntax you used in CatalogManager.properties:
I don't think my book ever uses such syntax for a relative path.  If it does, please show me where so I can fix it.  When I use that syntax in my CatalogManager.properties, my version of Java responds with the following first line of error:
  java.net.UnknownHostException: catalog.xml
It thinks file://catalog.xml is a network address.  Try using this instead:
Also, you don't want to set relative-catalogs=true because then relative paths in "catalogs=" are taken as relative to the XML document location.  When that property is false, then relative paths to catalog files are taken as relative to the CatalogManager.properties file, which is what I think you want.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
----- Original Message -----
Sent: Wednesday, January 18, 2006 12:03 AM
Subject: [docbook-apps] Problem with XML catalogs and Saxon

Hi all,

I am trying to set up the toolchain according to the directions from http://sagehill.net/docbookxsl/Catalogs.html
I have completed all the procedures described in the book.
Unfortunately, I can't set the toolchain to use local files (DTD and XSL).

Here is my directory tree:
+---catalog [contains catalog.xml and properties for the catalog resolver]
|   +---dtd [equiv. to dtd44]
|   |   \---ent
|   +---dtd44
|   |   \---ent
|   \---xsl [current XSL distro]
[zap: full DocBook XSL distro goes here]
\---docs [directory with many subdirectories with source files]


<?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 and stylesheet files installed under c:\public\ -->
  <group prefer="public" xml:base=" file:///c:/public/" >
         publicId="-//OASIS//DTD DocBook XML V4.4//EN"
    <!-- Resolve DTD URL system ID to local file -->
        rewritePrefix=" file://docbook/dtd/" />

        <!-- Resolve stylesheet URL to local file -->
        uriStartString="http://docbook.sourceforge.net/release/xsl/current/ "
        rewritePrefix="file:///docbook/xsl/" />
    <!-- Resolve DTD PUBLIC identifiers -->
    <nextCatalog  catalog=" file://docbook/dtd/catalog.xml" />



All environment variables are set.

I call the HTML transformation from c:\public\catalog and get the following results:

$ java com.icl.saxon.StyleSheet -x org.apache.xml.resolver.tools.ResolvingXMLReader -y org.apache.xml.resolver.tools.ResolvingXMLReader -r org.apache.xml.resolver.tools.CatalogResolver -u -o ../docs/sample.html file://../docs/sample.xml http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
Parse catalog: file:///c:/public/docbook/dtd/docbook.cat
Loading catalog: file://catalog.xml
Default BASE: file://catalog.xml
java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect (Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.NetworkClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.ftp.FtpClient.openServer(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream (Unknown Source)
        at java.net.URL.openStream(Unknown Source)
        at org.apache.xml.resolver.Catalog.parseCatalogFile(Unknown Source)
        at org.apache.xml.resolver.Catalog.parsePendingCatalogs(Unknown Source)
        at org.apache.xml.resolver.Catalog.parseCatalog(Unknown Source)
        at org.apache.xml.resolver.Catalog.loadSystemCatalogs(Unknown Source)
        at org.apache.xml.resolver.tools.CatalogResolver.initializeCatalogs (Unknown Source)
        at org.apache.xml.resolver.tools.CatalogResolver.<init>(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at com.icl.saxon.Loader.getInstance(Loader.java:91)
        at com.icl.saxon.StyleSheet.makeURIResolver(StyleSheet.java:551)
        at com.icl.saxon.StyleSheet.doMain (StyleSheet.java:164)
        at com.icl.saxon.StyleSheet.main(StyleSheet.java:47)
Resolved URI: file://../docs/sample.xml
resolveURI( http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl )
Resolved URI: http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
resolveSystem(http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl )
Transformation failed: java.io.EOFException: no more input

Could anybody help me with this? I know that many of you use XML catalogs, XIncludes etc. with success. Network restrictions in my company prevent access to the Internet, except for web browsers, so I have to use local files.

One thing, which makes me think, is that the example of the catalog.xml from Bob's book has parts that do not work with Saxon (or other Java-based processor). The book does not provide any solution that WORKS with Java-based processor.
I have searched throughout the archives of this list and haven't found the solution of my problem.

Thanks in advance,


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