Hi, I'm having problem creating a DTD to do what I need it to do.

Here's what I need.
Page element can have one/zero form element or zero/many other element.

Examples:
One:
<page>
  <other></other>
  <other></other>
  <form></form>
  <other></other>
</page>

Two:
<page></page>

Three:
<page>
  <other></other>
  <other></other>
</page>

Four:
<page>
  <form></form>
</page>

All the above should be valid. As long as there is more than one <form>
tag, it's invalid.
i.e: <page>
       <form></form>
       <form></form>
     </page>
Should generate a ParseError. If possible, I would like the example below
to generate an error as well.
<page>
  <other>
    <form></form>
  </other>
  <form></form>
</page>

I was going along the line of <!ELEMENT page (form?|other*)> but only
examples 2 - 3 will be valid and not example 1. If I write it as <!ELEMENT
page (form?|other*)*>, it's valid for examples 1-4 but it is also valid for
the invalid multiple <form> tag example.

Can anyone help?

Callista

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to