Reputation: 7245
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.
Upvotes: 1
Views: 345
Reputation: 18002
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.
Upvotes: 3