Hi Mike,

The XML Schema spec does give some hints about this topic, but it can be 
a bit hard to find. http://www.w3.org/TR/xmlschema-1/ section 4.3.2

Section 4.3.2 includes the following:

Processors on the Web are free to undertake �assessment� against 
arbitrary schemas in any of the ways set out in Assessing 
Schema-Validity (�5.2). However, it is useful to have a common 
convention for determining the schema to use. Accordingly, 
general-purpose schema-aware processors (i.e. those not specialized to 
one or a fixed set of pre- determined schemas) undertaking �assessment� 
of a document on the web must behave as follows:

- unless directed otherwise by the user, �assessment� is undertaken on 
the document element information item of the specified document;
- unless directed otherwise by the user, the processor is required to 
construct a schema corresponding to a schema document whose 
targetNamespace is identical to the namespace name, if any, of the 
element information item on which �assessment� is undertaken.


A bit later it says:
Schema Representation Constraint: Schema Document Location Strategy

Given a namespace name (or none) and (optionally) a URI reference from 
xsi:schemaLocation or xsi:noNamespaceSchemaLocation, schema-aware 
processors may implement any combination of the following strategies, in 
any order:
1 Do nothing, for instance because a schema containing components for 
the given namespace name is already known to be available, or because it 
is known in advance that no efforts to locate schema documents will be 
successful (for example in embedded systems);
2 Based on the location URI, identify an existing schema document, 
either as a resource which is an XML document or a <schema> element 
information item, in some local schema repository;
3 Based on the namespace name, identify an existing schema document, 
either as a resource which is an XML document or a <schema> element 
information item, in some local schema repository;
4 Attempt to resolve the location URI, to locate a resource on the web 
which is or contains or references a <schema> element;
5 Attempt to resolve the namespace name to locate such a resource.

Whenever possible configuration and/or invocation options for selecting 
and/or ordering the implemented strategies should be provided.


The way I interpret it, the Schema specification says that the processor 
(IDEA) should try to retrieve schema documents using all 
xsi:schemaLocation and xsi:noNamespaceSchemaLocation URIs in the 
document as well as optionally try to fetch a schema document using the 
root element namespace (unless the root element has a xsi:schemaLocation 
attribute). No other namespace declarations should be used to locate 
schema documents.

In the example given the root element is in the 
http://www.w3.org/2001/XMLSchema namespace
( <xsd:schema ... xmlns:xsd="http://www.w3.org/2001/XMLSchema"; ...) 
while the namespace declaration 
xmlns:wcf="http://www.dynabeans.com/CRML"; does not apply to the root 
element, it is just declared there.

Does this seem like a reasonable answer to your question?

/Fredrik Lindgren


Mike Aizatsky wrote:

> Christian,
> 
> Can you propose the way for IDEA to say that IDEA should try to validate
> against some namespaces, and don't validate against the others?
> 
> Best regards,
> Mike Aizatsky.
> ------------------------------
> JetBrains, Inc / IntelliJ Software
> http://www.intellij.com
> "Develop with pleasure!" 
> 
> 
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>>
> On
> 
>>Behalf Of Christian Sell
>>Sent: Friday, April 05, 2002 2:38 PM
>>To: [EMAIL PROTECTED]
>>Subject: [Eap-list] 615 XML schema same story
>>
>>Another old story: My schema file starts with the following line. IDEA
>>flags
>>the value of the xmlns:wcf attribute as an error, stating that it
>>
> cannot
> 
>>resolve the URL. I dont know where this idea of wanting to resolve
>>
> these
> 
>>URLs comes from - it does not make sense to me.
>>
>><xsd:schema
>>    targetNamespace="http://www.dynabeans.com/CRML";
>>    xmlns:wcf="http://www.dynabeans.com/CRML";
>>    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>>    elementFormDefault="qualified" attributeFormDefault="unqualified"
>>version="1.0">
>>
>>
>>
>>_______________________________________________
>>Eap-list mailing list
>>[EMAIL PROTECTED]
>>http://www.intellij.com/mailman/listinfo/eap-list
>>
> 
> 
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list
> 
> 



_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to