F
foolproofplan
Maybe I am looking to far into a simple problem, but I am having quite
a hard time figuring this out:
I am currently trying to create a schema to represent an Element which
contains other Elements (some of which have a restriction on how many
can occur). Here is an example of what I have done if that seems
confusing:
<xsd:element name="Object">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element ref="License" minOccurs="0"/>
<xsd:element ref="NameMemberReference" minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="ParentMemberReference" minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="Members"/>
<xsd:element ref="OnEdit" minOccurs="0"/>
<xsd:element ref="OnCommit" minOccurs="0"/>
<xsd:element ref="Permissions" minOccurs="0"/>
</xsd:choice>
<xsd:attribute ref="name" use="required"/>
</xsd:complexType>
</xsd:element>
I think the trouble with this is that the two elements that need to be
restricted to one occurance (NameMememberReference and
ParentMemberReference) are within an unbounded choice so they still
can be created multiple times.
I've played around with some other idea by using a Choice and an All
and I've also trying making groups but nothing has seemed to solve my
problem. Any ideas?
Thanks,
- Marc
a hard time figuring this out:
I am currently trying to create a schema to represent an Element which
contains other Elements (some of which have a restriction on how many
can occur). Here is an example of what I have done if that seems
confusing:
<xsd:element name="Object">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element ref="License" minOccurs="0"/>
<xsd:element ref="NameMemberReference" minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="ParentMemberReference" minOccurs="0"
maxOccurs="1"/>
<xsd:element ref="Members"/>
<xsd:element ref="OnEdit" minOccurs="0"/>
<xsd:element ref="OnCommit" minOccurs="0"/>
<xsd:element ref="Permissions" minOccurs="0"/>
</xsd:choice>
<xsd:attribute ref="name" use="required"/>
</xsd:complexType>
</xsd:element>
I think the trouble with this is that the two elements that need to be
restricted to one occurance (NameMememberReference and
ParentMemberReference) are within an unbounded choice so they still
can be created multiple times.
I've played around with some other idea by using a Choice and an All
and I've also trying making groups but nothing has seemed to solve my
problem. Any ideas?
Thanks,
- Marc