Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] using more then one schema within one XML

From: "Alessandro Triglia" <sandro@------.-->
To: "'John Cowan'" <jcowan@-------------.--->
Date: 11/4/2004 11:38:00 AM


> -----Original Message-----
> From: John Cowan [mailto:jcowan@r...] 
> Sent: Thursday, November 04, 2004 15:43
> To: Alessandro Triglia
> Cc: 'Chiusano Joseph'; 'pat'; 'XML :: dev'
> Subject: Re: [xml-dev] using more then one schema within one XML
> 
> 
> Alessandro Triglia scripsit:
> 
> > 4 xsi:schemaLocation and xsi:noNamespaceSchemaLocation 
> [attributes] can
> > occur on any element. However, it is an error if such an 
> attribute occurs
> > after the first appearance of an element or attribute 
> information item
> > within an element information item initially .validated. 
> whose [namespace
> > name] it addresses. [...]   
> > ---------------------
> > 
> > In other words, if a parser encounters a 
> xsi:noNamespaceSchemaLocation at
> > some place, then validates an element with no namespace, 
> then encounters
> > another xsi:noNamespaceSchemaLocation further on, it should 
> issue an error.
> 
> No, "it is an error" means that a document that does that is 
> in error.  There
> is no obligation on the part of a parser to notice the error 
> or to behave
> in any particular way.  


I have searched for all occurrences of "error" in Part 1, and I am =
surprised
by the result.

There is a key paragraph in 5.1:

---------------------------
The three cases described above are the only types of error which this
specification defines.   With respect to the processes of the checking =
of
schema structure and the construction of schemas corresponding to schema
documents, this specification imposes no restrictions on processors =
after an
error is detected.   However .assessment. with respect to schema-like
entities which do not satisfy all the above conditions is incoherent.
Accordingly, conformant processors must not attempt to undertake
.assessment. using such non-schemas.
---------------------------

The first sentence is not true, because there is at least another type =
of
error which this specification defines:  the error (in the instance)
specified in 4.3.2 regarding xsi:schemaLocation and
xsi:noNamespaceSchemaLocation.

The rest of the paragraph says that if a schema (or an XML =
representation of
a schema) has an error, it is not a schema, and must not be used as a
schema.  Even though the specification does not say what a processor =
must do
when it encounters an error in a schema (or in an XML representation of =
a
schema), it says what a processor must not do: perform assessment.

I haven't found any place in the Recommendation discussing the case of
*errors in the instance*.  (Again, the statement above regards strictly =
the
case of *errors in the schema*.)  

There is an interesting statement in clause 5 related to this issue:

-----------------------------
This specification distinguishes between errors in schema construction =
and
structure, on the one hand, and schema validation outcomes, on the =
other.
-----------------------------

The above is also not true, because there is a third kind:  errors in
instances.

I wonder what is the point in stating that "an instance has an error"
without specifying how this relates to the outcome of validation.
Intuitively, if an instance has an error, it is worse than invalid - it =
is a
non-instance, which cannot be validated.  Just like a schema that has an
error is a non-schema.  An "error" in the instance seems something =
half-way
between an XML 1.0 well-formedness error and a validity issue.

Why not just say that an overriding "xsi:schemaLocation" makes the whole
instance invalid?  Or alternatively, why not just say that an overriding
"xsi:schemaLocation" is non-significant but allowed?  Why was the term
"error" used at all for this case?

All the trouble comes from this use of the term "error" for something =
that
is wrong in the instance.  In all other cases, the term "error" is used =
for
something that is wrong in the schema.

Alessandro Triglia



> It can throw an exception, ignore the 
> new declaration,
> accept the new declaration, or make demons fly out of your nose.
> 
> -- 
> What is the sound of Perl?  Is it not the       John Cowan
> sound of a [Ww]all that people have stopped     
> jcowan@r...
> banging their head against?  --Larry            
> http://www.ccil.org/~cowan
> 


From ht@i... Fri Nov 05 08:55:45 2004
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.34)
	id 1CPzsn-0006NZ-S5
	for xml


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent