I have an xsd and am trying to validate my xml generated against it.
 However I have run into a strange problem with parent child elements and
whether they are required or not.  So if I have an xsd that looks something
like this:

<xsd:element ref="Parent" minOccurs="0">
<xsd:element name="Parent" type="Parent_Type"/>


<xsd:complexType name="Parent_Type">
<xsd:sequence>
  <xsd:element ref="Child" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>

When I try to compile my xml without Parent it complains that Child is
required, but when I took the same xml to an online validator against the
xsd it passed.

Which one is right?  If a Child element is required and a Parent is not
should it throw an error if the Child is not present, or should it only be
a problem if the Parent exists and lacks the Child?



Cheers,
Nicholas Ellis
Jr. Software Engineer
LeadKarma LLC
_______________________________________________
Xml-compile mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile

Reply via email to