[Xml-compile] XML::Compile::Schema validation on xs:ID has problem
Daniel Ruoso
daniel at ruoso.com
Fri May 16 11:43:03 BST 2008
Sex, 2008-05-16 às 12:14 +0200, Mark Overmeer escreveu:
> Are you sure that you are not confusing the regulations set for RFCs
> (from the IETF) "be strict in your implementation, but forgiving in what
> you receive", to the regulations for XML (by W3C) which are "be correct
> or you'll be refused"?
Yes. You're right. You actually have only two modes (validating and
non-validating processors). If you're "validating", uniqueness of IDs
MUST be checked, but if you're not checking it MUST NOT be checked.
Relevant quotes...
[xml spec sect. 5.1]
Non-validating processors are REQUIRED to check only the document
entity, including the entire internal DTD subset, for well-formedness.
[Definition: While they are not required to check the document for
validity, they are REQUIRED to process all the declarations they read
in the internal DTD subset and in any parameter entity that they read,
up to the first reference to a parameter entity that they do not read;
that is to say, they MUST use the information in those declarations to
normalize attribute values, include the replacement text of internal
entities, and supply default attribute values.] Except when
standalone="yes", they MUST NOT process entity declarations or
attribute-list declarations encountered after a reference to a
parameter entity that is not read, since the entity may have contained
overriding declarations; when standalone="yes", processors MUST process
these declarations.
Note that when processing invalid documents with a non-validating
processor the application may not be presented with consistent
information. For example, several requirements for uniqueness within
the document may not be met, including more than one element with the
same id, duplicate declarations of elements or notations with the same
name, etc. In these cases the behavior of the parser with respect to
reporting such information to the application is undefined.
[xml spec sect. 3.3.1]
Values of type ID MUST match the Name production. A name MUST NOT
appear more than once in an XML document as a value of this type;
i.e., ID values MUST uniquely identify the elements which bear them.
[rfc2119]
1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
definition is an absolute requirement of the specification.
2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the
definition is an absolute prohibition of the specification.
daniel
More information about the Xml-compile
mailing list