I have an XML Schema for the above structure. All the child elements of
<contact> are optional (minOccurs=0), of type string, and not allowed to be
empty (minLength=1) (whitespace is allowed...so a single space is valid).

Since the child elements are all optional, the schema does currently allow
an empty <contact> element as '<contact />' or '<contact></contact>'.

Q: How do I prevent the appearance of <contact /> from being valid? In
other words how do I force at least one child element to be present when
<contact> is present?

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!