You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to XML Schema
Hi,
I wish to create an XML document in which one of its elements must be
defined with one of two known attributes.
For example, I would like to define a "Parent" element as follows:
<xs:element name="Parent">
<xs:complexType>
<xs:attribute name="Name" type="xs:string"/>
<xs:attribute name="ID" type="xs:string"/>
</xs:complexType>
</xs:element>
but I only want a user to be able to define atleast one among ID and
name attribute
(i.e, I can have name and ID both or only ID or only name but none is
not possible).
It appears that the <xs:choice> construct accomplishes this for
elements. Is there a functional equivalent for attribute or another
way this can be achieved in XSD.