R
Rich Weed
<root>
<contact>
<name1>Joe Blough</name1>
<name2>c/o Blough, Inc</name2>
<addr1>123 Happy St</addr1>
<addr2>PO Box 1234</addr2>
<city>Anywhere</city>
<state>GA</state>
<zip>12345</zip>
</contact>
</root>
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?
TIA, RW
<contact>
<name1>Joe Blough</name1>
<name2>c/o Blough, Inc</name2>
<addr1>123 Happy St</addr1>
<addr2>PO Box 1234</addr2>
<city>Anywhere</city>
<state>GA</state>
<zip>12345</zip>
</contact>
</root>
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?
TIA, RW