List Info

Thread: Why is this schema valid?




Why is this schema valid?
user name
2006-07-27 08:07:44
Hi Yong,

"Yong Chen (yongche)" <chencisco.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

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )