[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Fall back to network DTD if local one not found
Thomas Schraitle <tom_schr <at> web.de> writes:
>
> Hi,
>
> On Donnerstag, 20. März 2008, John Brown wrote:
> > [...]
> >
> > I can then 'set SGML_CATALOG_FILES=catalog.xml'
>
<snip>
> However, in your case, you seem to use *XML* catalog, so
> SGML_CATALOG_FILES is wrong. Did you try it with the env variable
> XML_CATALOG_FILES?
>
I did not, but these are the results:
<!-- using bogus catalog file -->
C:\Book>set XML_CATALOG_FILES=non-existent.xml
C:\Book>set | find "CATALOG"
XML_CATALOG_FILES=non-existent.xml
Fri Mar 21 07:27:28 2008
C:\Book>xmllint --valid --noout book2.xml
Fri Mar 21 07:27:37 2008
<!-- Succeeded after 9 seconds - apparently network DTD used -->
<!-- using genuine catalog file -->
C:\Book>set XML_CATALOG_FILES=catalog.xml
C:\Book>set | find "CATALOG"
XML_CATALOG_FILES=catalog.xml
Fri Mar 21 07:27:37 2008
C:\Book>xmllint --valid --noout book2.xml
Fri Mar 21 07:27:38 2008
<!-- Succeeded after 1 second - apparently local DTD used -->
<!-- hiding local DTD; hoping to fall back to network DTD -->
C:\Book>cd \MSYS\share\xml\docbook\4.5
C:\MSYS\share\xml\docbook\4.5>move docbookx.dtd docbookx.dtd2
C:\MSYS\share\xml\docbook\4.5>cd \Book
Fri Mar 21 07:27:38 2008
C:\Book>xmllint --valid --noout book2.xml
book2.xml:3: warning: failed to load external entity
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
^
book2.xml:5: validity error : Validation failed: no DTD found !
<book lang="en">
Fri Mar 21 07:27:38 2008
<!-- failed after 1 second - did not try to use the network DTD -->
>
> I haven't look much in the details, but maybe debug your *XML* catalog
> first. You can do this with xmlcatalog (one line):
>
> xmlcatalog PATH_TO_YOUR_XML_CATALOG \
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
>
> The above line outputs the path to your local DTD. If you get "No entry
> for ..." then you should look into your XML catalog again.
>
This gives the same result as the xmllint commands above. It finds the
path to the local DTD. My problem is that, if I have followed the
instructions in Bob Stayton's tutorial correctly, then xmllint and friends
should try to fetch the DTD from the network, but they just give up.
> You can also debug the catalog processing with the environment variable
> XML_DEBUG_CATALOGS. In this case, xmllint is a bit more verbose. :)
>
After setting XML_DEBUG_CATALOG:
C:\Book>xmllint --valid --noout book2.xml
Resolve: pubID -//OASIS//DTD DocBook XML V4.5//EN sysID http://www.oasis-open.or
g/docbook/xml/4.5/docbookx.dtd
880 Parsing catalog catalog.xml
catalog.xml added to file hash
Found system match http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd, using
c:/msys/share/xml/docbook/4.5/docbookx.dtd
Resolve URI c:/msys/share/xml/docbook/4.5/docbookx.dtd
book2.xml:3: warning: failed to load external entity "http://www.oasis-open.org/
docbook/xml/4.5/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
^
book2.xml:5: validity error : Validation failed: no DTD found !
<book lang="en">
^
Catalogs cleanup
Free catalog entry -//OASIS//DTD DocBook XML V4.5//EN
Free catalog entry DocbookDTD
Free catalog entry http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
<!-- long list of catalog entries snipped -->
Free catalog entry
My XML file header:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
From the above output, it maps http://www.osais-open.org/.../docbookx.dtd
to c:/msys/share/xml/docbook/4.5/docbookx.dtd. This file no longer exists,
so it reports that it cannot load the external entity
http://www.osais-open.org/.../docbookx.dtd. However, it does not try to
use the literal value http://www.osais-open.org/.../docbookx.dtd.
C:\Book>
> Hope these ideas help a bit,
> Tom
>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]