[xquery-talk] RE: What identifies an XML schema in XQuery, target namespace or schema location?

Michael Kay mike at saxonica.com
Mon Jan 14 08:41:41 PST 2008


 > So my question is,   Which is more reasonable for a general XQuery
processor to identify the schema, target namespace or schema location  
 
There are a number of reasonable approaches - but the specification
deliberately leaves room for implementors to come up with others.
 
One approach is for the system to maintain some kind of catalog of schema
documents (perhaps precompiled; perhaps requiring them to be loaded into an
XML database), in which a namespace URI is sufficient to identify the schema
components relating to that namespace. In this situation it is reasonable to
ignore the schema location entirely.
 
Another approach is to rely entirely on the schema location: always load the
schema document at that location, and then perform consistency checks
against other schema components for the same namespace.
 
A third approach is to start with the namespace, using the existing schema
components for that namespace if available, and to use the schema location
only if no schema for that namespace has already been loaded.
 
Saxon by default uses the third approach. But the behaviour is controlled
using a URIResolver that you override - rather like the Java ClassLoader -
it you want to adopt a different strategy.
 
Michael Kay
http://www.saxonica.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20080114/de002102/attachment.htm


More information about the talk mailing list