On Wed, Mar 20, 2002 at 10:15:56AM +0100, Hans Hagen wrote:
> Hi,
> 
> How does the DTD part looks that permits the following?
> 
> <one> <a>...</a> <b>...</b> <c>...</c> </one>
> <one> <b>...</b> <c>...</c> <a>...</a> </one>
> <one> <a>...</a> </one>
> 
> or: arbitrary order of two optional elements b,c and one mandatory element a
> 
> [from DTD descriptions i deduce that the arbitrary order is not permitted 
> in XML, is this right? I wonder if it is valid in schemata.]

Pattern is ((%B;?, a) | (a, %B;)),
with %B; = (b | bc | c | cb) or %B; = ((b, c?) | (c, b?))

The second form looks more sophisticated, but it is not really shorter.

It is hard to be restrictive for this sort of complicated
pattern. This would be the usual formulation, but it is more
permissive:

((b | c)*, a, (b | c)*).

-- 
Simon Pepping
email: [EMAIL PROTECTED]

Reply via email to