I want to modell the following in XSD (XML Schema definition).
I have the following relationship between three classes:
Textuell description:
In my XSD each class is modelled as a complexType
.
Is it possible to to model the constraint (orange note, last point) in XSD ? If yes, how? In UML I'd use a Composite Structure Diagram or OCL .
I believe this is referred to as a co-constraint: you want to put a rule into Trigger
's definition that impacts the content of two other things at the same time: something in Widget
must contain something from Action
.
You can't do that with XSD, but you can do it with Schematron . Schematron will let you write a rule with an XPath expression that checks a contains relationship . That Xpath expression would then be your rule that you'd check against.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.