Re: Prohibiting duplicate attributes.

From
James Clark <>
Date
2001-06-11T05:33:51+00:00
ID
061401c0f237$ccef6ce0$
Thread
Re: Prohibiting duplicate attributes.
The only thing that concerns me about this is the relationship between
<group> and <oneOrMore>.

If, for some pattern p,

  <oneOrMore> p </oneOrMore>

is allowed, then it would seem to me that

  <group> p p </group>

should also be allowed.

The proposal disallows:

  <group>
    <attribute name="foo"/>
    <attribute name="foo"/>
  </group>

Thus, by the above rule,

  <oneOrMore><attribute name="foo"/></oneOrMore>

should also be disallowed. This seems quite reasonable: it makes no sense
for an <attribute> inside <oneOrMore> to contain any literal names
"positively".

But now consider:

  <group>
    <attribute><anyName/></attribute>
    <attribute><anyName/></attribute>
  </group>

The proposal disallows this.  But, by the rule I suggest above, it would
follow that

  <oneOrMore>
    <attribute><anyName/></attribute>
  </oneOrMore>

should also be disallowed.  Yet, clearly we can't disallow that, because we
need to be able to match well-formed XML.

So my question is, how can it make sense to allow

  <attribute><anyName/></attribute>

or

  <oneOrMore>
    <attribute><anyName/></attribute>
  </oneOrMore>

or

  <zeroOrMore>
    <attribute><anyName/></attribute>
  </zeroOrMore>

but not

  <group>
    <attribute><anyName/></attribute>
    <attribute><anyName/></attribute>
  </group>

?

James