Lists Home |
Date Index |
You don't say what schema language (or DTD?) you are working with. It is
cumbersome to express these constraints without order in DTD or XML
Schema. XML Schema's 'all' will not allow more than once. You would be
forced to write out the alternatives by hand. For example, for three
required elements a, b and c, without order.
(The DTD-style notation would need to be translated into the much
bulkier XML Schema syntax.)
When all of the alternatives are optional and some can be repeated, more
thought is required but the pattern is the same. For example, suppose a
can occur only once, b and c more than once.
Note that the number of subexpressions expands exponentially as the
number of subelements increases.
In RELAX NG, however, this would be trivial to write. The following is
in the RELAX NG compact syntax:
a? & b* & c*
Ben Ryan wrote:
> Apologises if this is the wrong list to post to. Please could
> someone advise if there is a more appropriate list.
> I am trying to model the following:
> An element has a number of subelements that are not ordered.
> All of these subelements are optional.
> Certain of the subelements can occur more than once.
> Ceratin of the subelements can only occur once.
> If I use a choice model I need to make it unbounded to allow the
> occurrence of more than one subelement.
> If I do this then all the subelements can occur more than once.
> I can work around this using sequence models but the standard am
> I following does not specify order.
> Any help would be appreciated.
> Dr Ben Ryan
> HLSI Software Development Manager
> University of Huddersfield
> Tel: 01484 473587
> E-mail: email@example.com