need no-ordering with each element potentially occurring n times, which
is not allowed for some reason.
Historically, it was very difficult to generate a finite state machine
which would efficiently validate that sort of constraint in the general
case, so parsers of all kinds (not just XML validation) tended to be
written to forbid it. There are newer techniques which will handle it,
but since in practice there is almost never a NEED for that kind of
constraint the folks defining languages don't like writing such a
requirement into their specifications. Also, standards groups worry
about how well the data will interchange with other systems (eg
databases) which don't support that kind of constraint.
Remember, schema or DTD is only the first level of validation --
higher-order syntax checking, if you will -- and you will often
want/need to impose additional checking at the application level. If you
need this constraint, consider leaving the count unconstrained at the
schema level and imposing limits in your application code.
There's always the Horribly Ugly solution of having the schema
explicitly spell out all the possible combinations/orderings of the
children.
But the best answer is to reconsider your document design -- ask whether
there's another way to represent your data which doesn't require this
combination of unordered and frequency-limited. In 99.5% of the cases
I've seen, that requirement evaporates when you stop to think about how
the documents will actually be produced and used and whether some of the
entries should be grouped together under parent elements rather than all
being siblings.
As far as RelaxNG goes: What I heard about it early on was that it was a
lot more straightforward for many of the common cases than XML
Schemas... but I don't know what its status is or how heavily it has
been stress-tested since then. I do know that the single biggest issue
remains portability -- RelaxNG may be a fine choice if you have complete
control over both the document's generator and consumer, but it may not
help you much when working with other folks who don't have a
RelaxNG-enabled system. It's reportedly possible to generate an XML
Schema from a RelaxNG document spec... but that involves giving up any
constraints that Schema doesn't easily support.
--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html
{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."