[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Saxon and XML Catalogs
Hi again -
I'm having difficulty convincing Xerces and Saxon to not try to access the
DocBook DTD on oasis-open.org when it does a build. I'm using the XML
Catalog, and the verbose output implies it'd use the local copy for the
actual validation (I don't know yet), but it still accesses the network to
resolve the system URL specified in the XML file.
I expected it to never access the network, because the catalog resolves
the public DTD URL locally. I need it to not access the network at all.
Am I misunderstanding a principle, or is this what's supposed to happen?
I'm using Java 1.4.2 (and testing with 1.5.0_06 as well), Xerces 2.8.0,
Saxon 6.5.5.
I'm confident my classpath is set correctly. The appropriate classes are
being loaded, and CatalogManager.properties is being recognized. I can
adjust the verbosity property to get debugging output from the resolver.
My files are organized about like this (paths simplified):
/docbook/schemas/docbook-4.4/catalog.xml
/docbook/schemas/docbook-4.4/docbook.cat
/docbook/schemas/docbook-4.4/...
/docbook/tools/CatalogManager.properties
/project/mybook.xml
/templates/mytemplate.xsl
CatalogManager.properties reads as follows:
- -
catalogs=../schemas/docbook4-4/catalog.xml;../schemas/docbook-4.4/docbook.cat
relative-catalogs=false
static-catalog=true
verbosity=4
- -
My args to Saxon:
-x org.apache.xml.resolver.tools.ResolvingXMLReader
-y org.apache.xml.resolver.tools.ResolvingXMLReader
-r org.apache.xml.resolver.tools.CatalogResolver
-u
(Without the -u I don't get the word "override" in my debug output, so I
assume it's needed, but I don't understand why.)
mybook.xml begins as follows:
- -
<?xml version="1.0" standalone="no"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
>
<book id="TestBookOne">
...
- -
The verbosity=4 output is as follows (paths simplified, output shortened):
- -
Parse catalog: file:/docbook/schemas/docbook-4.4/docbook.cat
Loading catalog: file:/docbook/schemas/docbook-4.4/docbook.cat
Default BASE: file:/docbook/schemas/docbook-4.4/docbook.cat
override: yes
OVERRIDE: yes
public: -//OASIS//DTD DocBook XML V4.4//EN
docbookx.dtd
PUBLIC: -//OASIS//DTD DocBook XML V4.4//EN
file:/docbook/schemas/docbook-4.4/docbookx.dtd
system: http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
docbookx.dtd
SYSTEM: http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
file:/docbook/schemas/docbook-4.4/docbookx.dtd
system: http://docbook.org/xml/4.4/docbookx.dtd
docbookx.dtd
SYSTEM: http://docbook.org/xml/4.4/docbookx.dtd
file:/docbook/schemas/docbook-4.4/docbookx.dtd
public: -//OASIS//DTD DocBook CALS Table Model V4.4//EN
calstblx.dtd
PUBLIC: -//OASIS//DTD DocBook CALS Table Model V4.4//EN
file:/docbook/schemas/docbook-4.4/calstblx.dtd
public: -//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN
htmltblx.mod
PUBLIC: -//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN
file:/docbook/schemas/docbook-4.4/htmltblx.mod
[...]
public: ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML
ent/isocyr2.ent
PUBLIC: ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML
file:/docbook/schemas/docbook-4.4/ent/isocyr2.ent
resolveURI(file:/project/mybook.xml)
Parse catalog: file:/docbook/schemas/docbook-4.4/docbook.cat
Loading catalog: file:/docbook/schemas/docbook-4.4/docbook.cat
Default BASE: file:/docbook/schemas/docbook-4.4/docbook.cat
PUBLIC: -//OASIS//DTD DocBook XML V4.4//EN
file:/docbook/schemas/docbook-4.4/docbookx.dtd
PUBLIC: -//OASIS//DTD DocBook CALS Table Model V4.4//EN
file:/docbook/schemas/docbook-4.4/calstblx.dtd
[...]
resolveURI(file:/project/mybook.xml)
Resolved URI: file:/project/mybook.xml
file:/project/mybook.xml
resolveURI(file:/templates/mytemplate.xsl)
resolveURI(file:/templates/mytemplate.xsl)
Resolved URI:
file:/templates/mytemplate.xsl
file:/templates/mytemplate.xsl
resolveSystem(http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd)
resolveSystem(http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd)
resolvePublic(-//OASIS//DTD DocBook
V4.4//EN,http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd)
resolvePublic(-//OASIS//DTD DocBook
V4.4//EN,http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd)
- -
I know it is going to the network for the DTD every time it builds a file
because I can change the oasis-open.org URL to a localhost URL on a port
listening for HTTP requests, and I see them happen with my listener. My
listener returns a success code but no other data, and the build still
succeeds. If I cause the network access to fail, such as by using the
original DTD URL and unplugging the network cable, or by using the
localhost URL and shutting down my listener app, the build fails.
Thanks for any assistance you can provide!
-- Dan
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]