Notes:
[1. Mostly looking to confirm, "No, they can't."]
[2. Would be pleased to learn of a (DTD, not Schema) work-around/kludge ? Thx.]
Question:
Do XML DTDs let me express this? "Must be at least one, can be many."
I know that:
foo? means 0 or 1.
foo* means 0 or many.
foo means 1 (and only 1).
I would like to have a DTD to constrain these 3 data examples:
1. NO: 0 'bar'
<foo>
</foo>
2. YES: 1 'bar'
<foo>
<bar>stuff</bar>
</foo>
3. YES: "N" 'bar's
<foo>
<bar>stuff a</bar>
<bar>stuff b</bar>
</foo>
This is NOT it:
<!ELEMENT foo (bar)*>
This is NOT it, either:
<!ELEMENT foo (bar)?>
NOR this:
<!ELEMENT foo (bar)>
THANK YOU.
William Reilly
Cambridge, Mass. USA |