Maybe I've been staring at this problem for too long, maybe there isn't an answer; either way I'm here now.I'm trying to permit a set of possible combinations in an XSD, but I can't seem to find an approach that doesn't result in ambiguity.Quick regexy respresentation:\[code\]foo+ ( bar baz* | bar? baz+ qux* )\[/code\]
Now, I'm beginning to realize that perhaps this is simply a constraint of the XSD content model. The reason for ambiguity is obvious; the solution not so.Can anyone see a means with which I can permit this; by re-ordering the elements, through use of some schema design pattern to alleviate ambiguous scenarios like this?The condition dependency of \[code\]bar\[/code\] and \[code\]baz\[/code\] is clearly the problem, but I can't think of any other way to do this.Thanks so much in advance folks.Edit: Currently reading "Schema Component Constraint: Unique Particle Attribution" in an attempt to find a loop-hole. Any other suggested reading welcome.
- \[code\]foo\[/code\] is required (one-or-more)
- If \[code\]bar\[/code\] exists, \[code\]baz\[/code\] is optional (zero-or-more)
- If \[code\]baz\[/code\] exists, \[code\]bar\[/code\] is optional (zero-or-one) and \[code\]qux\[/code\] is optional (zero-or-more)
- \[code\]qux\[/code\] can not exist if \[code\]baz\[/code\] does not exist