Forum Moderators: open
I want to create a DTD that enforces the following rules:
<!-- this is OK. -->
<o>
<pet>
<dog>
<collar/>
</dog>
</pet>
</><!-- this is also OK -->
<o>
<hot>
<dog>
<meat/>
</dog>
</hot>
</o>
<!-- however I want to prevent this -->
<o>
<pet>
<dog>
<meat/>
</dog>
</pet>
</o>
<!-- this is also NOT OK -->
<o>
<hot>
<dog>
<collar/>
</dog>
</hot>
</o>
the DTD definition I have of "dog" lets either happen
<!ELEMENT dog (collar,meat)>
is there a technique in DTD that will prevent a hotdog from having a collar, and a pet dog from containing meat?