Re: [xml] Catalog & Schema



On Thursday 25 November 2004 21:55, Daniel Veillard wrote:
On Thu, Nov 25, 2004 at 09:35:27PM +0000, Frans Englich wrote:
On Thursday 25 November 2004 20:52, Daniel Veillard wrote:
On Thu, Nov 25, 2004 at 07:58:26PM +0000, Frans Englich wrote:
        rewritePrefix="file://schemata/" />

  asking libxml2 to load them from the machine "schemata" using an
unknown "file" protocol. Unlikely to work...

Yes, borked. So you're saying that catalogs should work with for example
Schema and that the problem should be caused by that invalid catalog
entry?

  Let's be very clear. All URL/File loading from libxml2 goes though
the catalog, with the sole exception of the catalog file themselves
because this is forbidden by the Catalog spec.

That's what I thought. 

  I see no reason why schemas or relaxng would be any different.
You need to debug your catalog but there are ways to do this !
  http://xmlsoft.org/catalog.html#validate

Perhaps you can tell something from the bash sequence below. That there is no 
debug output from validating the Schema pussles me.

bash-2.05b$ export | grep XML
declare -x XML_CATALOG_FILES="catalog.xml"
declare -x XML_DEBUG_CATALOG="1"
bash-2.05b$ ls catalog.xml
catalog.xml
bash-2.05b$ xmllint --noout --schema lib/catalog.xsd catalog.xml  # Schema 
from OASIS
catalog.xml validates
bash-2.05b$
bash-2.05b$ xmllint --version
xmllint: using libxml version 20616
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude 
Iconv Unicode Regexps Automata Schemas
bash-2.05b$
bash-2.05b$ xmllint --nonet --noout --xinclude --postvalid docs/design.xml
Resolve: pubID -//OASIS//DTD DocBook XML V4.1.2//EN sysID 
http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
16384 Parsing catalog catalog.xml
catalog.xml added to file hash
Found system match http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
Catalogs cleanup
Free catalog entry http://www.totte.org/NS/
Free catalog entry http://www.w3.org/1999/xhtml
Free catalog entry ../../www/docbook/
Free catalog entry -//OASIS//DTD DocBook XML V4.3//EN
Free catalog entry http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
Free catalog entry catalog.xml
Free catalog entry
bash-2.05b$ xmllint --memory --nonet --noout --schema 
schemata/TestDescriptor.xsd tests/xmlValidness.xml
I/O warning : failed to load HTTP resource
schemata/TestDescriptor.xsd:176: element attribute: Schemas parser error : 
Attribute decl. 'mimetype', attribute 'type': The QName value 
{'http://www.totte.org/NS/Common', 'mime'} does not resolve to a(n) simple 
type definition.
schemata/TestDescriptor.xsd:143: element element: Schemas parser error : 
Element decl. 'executable', attribute 'type': TheQName value 
{'http://www.totte.org/NS/Common', 'filename'} does not resolve to a(n) type 
definition.
schemata/TestDescriptor.xsd:159: element element: Schemas parser error : 
Element decl. 'mimetype', attribute 'type': The QName value 
{'http://www.totte.org/NS/Common', 'mime'} does not resolve to a(n) type 
definition.
schemata/TestDescriptor.xsd:131: element element: Schemas parser error : 
Element decl. 'package', attribute 'type': The QName value 
{'http://www.totte.org/NS/Common', 'softwarePackage'} does not resolve to 
a(n) type definition.
WXS schema schemata/TestDescriptor.xsd failed to compile
bash-2.05b$                                                                               

I might add that catalog.xsd is unmodified, just as libxml2. 

However, it do work flawlessly when I run this:

bash-2.05b$ xmlcatalog  catalog.xml http://www.totte.org/NS/Common.xsd
Resolve sysID http://www.totte.org/NS/Common.xsd
16384 Parsing catalog catalog.xml
catalog.xml added to file hash
Using rewriting rule http://www.totte.org/NS/
schemata/Common.xsd
Catalogs cleanup
Free catalog entry http://www.totte.org/NS/
Free catalog entry http://www.w3.org/1999/xhtml
Free catalog entry ../../www/docbook/
Free catalog entry -//OASIS//DTD DocBook XML V4.3//EN
Free catalog entry http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
Free catalog entry catalog.xml
Free catalog entry
bash-2.05b$  

I also tried --debugent but there was no mentionings of catalog files, and it 
tried to load the web URL.

It looks like the catalog isn't activated when xmllint is run. What have I 
done wrong? 


Cheers,

                Frans



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]