i have a little problem with an exisiting XSD and an additional rule I want to implement. Here's a part of my original XSD:
<xs:complexType name="action"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="actid" type="xs:string" use="required" /> <xs:attribute name="acttyp" type="acttype" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:simpleType name="acttype"> <xs:restriction base="xs:string"> <xs:enumeration value="type1" /> <xs:enumeration value="type2" /> <xs:enumeration value="type3" /> <xs:enumeration value="type4" /> </xs:restriction> </xs:simpleType>
So you see there are actions with different actiontypes I defined. Now there is a new rule, if there is a special actid, let's take "123", than there is only type1 permitted. So to show you:
<action actid="123" acttype="type1"> = permitted <action actid="234" acttype="type1"> = permitted <action actid="234" acttype="type2"> = permitted <action actid="123" acttype="type2"> = forbidden
Is there a way to do this with xsd? I don't know how to combinate the enum with that rule. Anybody can help me?
No comments:
Post a Comment