rajneesh4u
Systems Engineer
Hello All,
I am new to XSD and XML and need to explore if there is option to make sure that any one attribute in a set of attributes within same element is required.
Example:
<xs:element name="where" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="condition" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="alias1" use="required"/>
<xs:attribute type="xs:string" name="col1" use="required"/>
<xs:attribute type="xs:string" name="operator" use="required"/>
<xs:attribute type="xs:string" name="string" use="optional"/>
<xs:attribute type="xs:string" name="number" use="optional"/>
<xs:attribute type="xs:string" name="date" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Here I want to ensure that minimum one attribute in a set of 3 attributes (mentioned as optional in above) are required. All can not be optional , however any one (can be more than one also) is required.
Thanks,
Rajneesh
I am new to XSD and XML and need to explore if there is option to make sure that any one attribute in a set of attributes within same element is required.
Example:
<xs:element name="where" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="condition" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="alias1" use="required"/>
<xs:attribute type="xs:string" name="col1" use="required"/>
<xs:attribute type="xs:string" name="operator" use="required"/>
<xs:attribute type="xs:string" name="string" use="optional"/>
<xs:attribute type="xs:string" name="number" use="optional"/>
<xs:attribute type="xs:string" name="date" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Here I want to ensure that minimum one attribute in a set of 3 attributes (mentioned as optional in above) are required. All can not be optional , however any one (can be more than one also) is required.
Thanks,
Rajneesh