Re: [xml] Catalog & Schema



On Fri, Nov 26, 2004 at 11:14:45AM +0100, Kasimier Buchcik wrote:
Well all I can tell is that:
  xmllint --schema uses xmlSchemaParse()
  xmlSchemaParse uses xmlReadFile()
  xmlReadFile() uses xmlCreateURLParserCtxt()
  xmlCreateURLParserCtxt() uses xmlLoadExternalEntity()
[...]

For <import>s and xsi driven document loading, _xmlCtxtReadFile_ is used
 - in xmlSchemaAcquireSchemaDoc. So there might be a difference in
loading the main schema and <include>s, compared to loading an <import>.
Anyway, I think using xmlCtxtReadFile could be avoided, if this is the
one which makes trouble.

that should work the same way but xmlCtxtReadFile() calls
xmlNewInputFromFile() and goes a different stack of functions,
and seems to bypass the resolver. It seems this is the bug
and should be changed to 
  stream = xmlLoadExternalEntity(filename, NULL, ctxt);
which is garanteed to go through the resolver/catalog.
I'm pretty sure now that xmlNewInputFromFile() should not be called
directly, I commited the fix in CVS, Frans if you have a chance to
load the CVS version in a couple of hours to check that the change
fix the bug that would be nice.

Kasimier, BTW while you're at allocating the parser context yourself
in that routine, you should as well share the same dictionnary ctxt->dict.
Check xmlXIncludeParseFile() in xinclude.c to see how to reuse 
dictionnaries for multiple documents (via the parser context).
Maybe I should provide a new routine to setup the dictionnary of a
parser context...

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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