[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: If I want to use catalogs for XSDs, must documentinstances
On Fri, 2012-04-20 at 12:29 +0800, Graham Hannington wrote: > If I want a catalog-aware XML application (such as jEdit with XML plugin, > or Altova XMLSpy 2012) to use a catalog to locate XSDs to validate XML > document instances, must the XML document instances contain schemaLocation > attributes? No. > I had hoped that perhaps these applications might look at the xmlns: > attribute values (namespace URIs) in a document instance, and use the > catalog to map these namespace URIs to the location of the corresponding > XSD files, but that does not work for me in practice. Neither should it. There is no direct mapping between namespace URIs and Schema documents; the relationship is that Schema documents may define elements associated with one or more namespace URIs. It's a many*/many* relationship: an XML document might not use any namespaces at all and yet still have one or more XML Schema documents used to validate it. You might use any of several schema documents (or several at once) depending on your goals. > > So, either: > - The answer is "yes" (the document instances must contain schemaLocation > attributes) > - The answer is "no", and I'm doing something wrong in my catalog The answer is that you have to tell your schema processor how to find he schemas, and that schemaLocation attributes are one way, but not the only way - the program might have another way to do it - but doing it based on namespace URIs would not be a good way. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|