I want to validate following XML. Where a branch can have no or multiple managers and/or accountants. Their order is random. What I have tried is as follows:
<!ELEMENT branch (office, manager*, accountant*)>
But I am getting error, and I know above statement is making order strict. How can I avoid the order of manager and accountant.
The XML:
<branch name = "south">
<office>
<addr>St. 32, Downtown</addr>
</office>
<manager>
<username>
knitemorgan
</username>
</manager>
<accountant>
<username>
johnsmith
</username>
</accountant>
<manager>
<username>
jenifer
</username>
</manager>
<accountant>
<username>
fclark
</username>
</accountant>
<branch>
<branch name = "north">
<office>
<addr>St. 328, Downtown</addr>
</office>
<accountant>
<username>
rogerbentley
</username>
</accountant>
<manager>
<username>
wendymaria
</username>
</manager>
<branch>
Try something like this:
This means exactly one
officefollowed by zero or moremanageroraccountant.Order doesn’t matter with the
manageroraccountantbecause of the|.