Re: [xml] Why is this schema valid?



Hi Yong,

"Yong Chen (yongche)" <chen cisco com> writes:

I have a schema (see at the end of email), I thought it was invalid,
since the "Naming" element in "group1" has the same name as the "Naming"
element in "group2", causing the content of element "Hello" to be
non-deterministic.

It is not non-deterministic. It violates the so-called "consistent
declaration rule" which requires two elements in the same type with
the same name to be of the same type. In your case they are of
different (anonymous) types so this schema is invalid regardless of
the minOccurs value.

The fact that libxml2 does not detect this is a bug.


hth,
-boris


-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]