Hello,
leider ist eine DTD als solche relativ beschränkt was die Kürze der Ausdrucksweise angeht. Deine Anforderungen dürften sich leichter in ein XML Schema fassen lassen, obwohl dies normalerweise weitaus mehr Platz in Anspruch nimmt und schlechter zu lesen ist.
Dein Problem lässt sich mMn am Besten von innen nach außen lösen:
Die Element sub1, sub2, sub3: (sub1, sub2, sub3)
1x, mehrmals, optional: (sub1, sub2+, sub3?)
und das alles in beliebiger Reihenfolge aber genau ein Mal: hier müssen wir ein ODER benutzen und die Permutationen aufzählen. Und sag mir bitte nicht, dass das bei mehr als 4 Elementen keinen Spaß mehr macht...
((sub1, sub2+, sub3?)|(sub1, sub3?, sub2+)|(sub2+,sub1,sub3?)|...)
MfG
Rouven
--
-------------------
Computer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice. Like drawing, it can be shaped to a variety of ends: commercial, artistic, and pure entertainment. Programmers have a well-deserved reputation for working long hours but are rarely credited with being driven by creative fevers. Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination, but because their imagination reveals worlds that others cannot see. -- Larry OBrien and Bruce Eckel in Thinking in C#
-------------------
Computer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice. Like drawing, it can be shaped to a variety of ends: commercial, artistic, and pure entertainment. Programmers have a well-deserved reputation for working long hours but are rarely credited with being driven by creative fevers. Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination, but because their imagination reveals worlds that others cannot see. -- Larry OBrien and Bruce Eckel in Thinking in C#