This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Saxon and Catalog Resolver
- From: John Himpel <jwhimpel at tseinc dot com>
- To: docbook-apps at lists dot oasis-open dot org
- Date: 03 Sep 2003 21:17:39 -0500
- Subject: [docbook-apps] Saxon and Catalog Resolver
Hi,
I am struggling with a tools problem.
I have a minimal .xml document marked up and validated.
I have a small customization layer for my stylesheets.
I have several chained catalog.xml files.
The contents of ./xml/catalog.xml follows:
<?xml version='1.0'?>
<!-- $XFree86: xml-work/xml/catalog.xml,v 1.3 2003/06/25 21:49:13
jwhimpel Exp $ -->
<!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'>
<public
publicId='-//OASIS//DTD DocBook XML V4.1.2//EN'
uri='./docbook/oasis-open/xml-dtd-4.2/docbookx.dtd' />
<system
systemId='http://www.oasis-open/docbook/xml/4.1.2/docbookx.dtd'
uri='./docbook/oasis-open/xml-dtd-4.2/docboox.dtd' />
<nextCatalog catalog='./docbook/oasis-open/xml-dtd-4.2/catalog.xml' />
<nextCatalog catalog='./docbook/oasis-open/docbook-xsl/catalog.xml' />
<nextCatalog catalog='./docbook/oasis-open/MathML/catalog.xml' />
<nextCatalog catalog='./docbook/XFree86/catalog.xml' />
<nextCatalog catalog='./docbook/w3/MathML/catalog.xml' />
</catalog>
When I run xsltproc using fo/docbook.xsl as the stylesheet and setting
XML_CATALOG_FILES to ./xml/catalog.xml and no internet access, xsltproc
runs
fine.
When I run the following saxon.sh file with internet access it runs
fine.
SAXON_BIN=/usr/local/Saxon
SAXON_EXTENSIONS_BIN=/home/??????/XFree86/Devel/xml/docbook/oasis-open/docbook-xsl/extensions
XALAN_BIN=/usr/local/Xalan/xalan-j_2_5_1/bin
CLASSPATH=${CLASSPATH}:\
${SAXON_BIN}/saxon.jar:\
${SAXON_EXTENSIONS_BIN}/saxon651.jar:\
${XALAN_BIN}/xercesImpl.jar:\
./xml
export CLASSPATH
/usr/java/j2sdk1.4.1_02/bin/java \
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \
-Djax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \
com.icl.saxon.StyleSheet \
-o fo/${1}.fo \
-x org.apache.xml.resolver.tools.ResolvingXMLReader \
-y org.apache.xml.resolver.tools.ResolvingXMLReader \
-r org.apache.xml.resolver.tools.CatalogResolver \
-u \
${1}.xml \
xml/docbook/oasis-open/docbook-xsl/fo/docbook.xsl \
use.extensions=1
My CatalogManager.properties files resides in ./xml and is as follows:
catalogs=catalog.xml
relative-catalogs=false
static-catalog=yes
catalog-class-name=org.apache.xml.resolver.Resolver
verbosity=4
When I run the above saxon.sh file without internet access, it get the
following stack trace.
java.lang.ArrayIndexOutOfBoundsException: 3
at org.apache.xml.resolver.readers.TextCatalogReader.nextToken(Unknown
Source)
at
org.apache.xml.resolver.readers.TR9401CatalogReader.readCatalog(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(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at com.icl.saxon.Loader.getInstance(Loader.java:91)
at com.icl.saxon.StyleSheet.makeURIResolver(StyleSheet.java:559)
at com.icl.saxon.StyleSheet.doMain(StyleSheet.java:180)
at com.icl.saxon.StyleSheet.main(StyleSheet.java:63)
Possible causes that occur to me are are:
1) An incorrect CatalogManager.properties file
2) A problem in saxon.sh
3) A problem in one of my catalog.xml files that is tolerated by
xsltproc and is
fatal to Norm's resolver classes.
4) A bug in Norm's resolver classes (highly unlikely).
Also, please be aware that I have placed resolver-1.0.jar in
/usr/java/j2sdk1.4.1_02/jre/lib/endorsed.
I know many others have gotten this work, so it must be something really
dumb that I have done.
If I had a clue as to which entity it is trying to resolve, it would be
useful.
Any guidance would be greatly appreciated.
John
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org.