try it.

implementation wise i dont see a problem,
all 'other' instances until the 'form' match
with the first 'other'. if there is no 'form',
the second 'other' must be empty...

----- Original Message -----
From: "Hilary Bannister" <[EMAIL PROTECTED]>
To: "xerces user group" <[EMAIL PROTECTED]>
Sent: Tuesday, April 03, 2001 12:19 AM
Subject: Re: Need help with DTD


> Will this work as the solution:
>
> <!ELEMENT page (other*|form?|other*)>
>
> as it is non-deterministic and I am led to believe that every content
model
> must
> be deterministic.  Am I wrong?
>
>  <!ELEMENT page (other*|form|other*)>
>
> is deterministic because the form is required so you know which set the
> "other" instances belong to.  The above optional version cannot determine
> which set the "other" instances belong to if the form is missing.
>
>
>
> ----- Original Message -----
> From: E. de Haan <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: 01 April 2001 11:42
> Subject: Re: Need help with DTD
>
>
> > ----- Original Message -----
> > From: "callista" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, April 02, 2001 9:53 AM
> > Subject: Need help with DTD
> >
> > > 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
> > > ---------------------------------------------------------------------
> >
> > In my opinion example 1 should be invalid,
> >
> > <!ELEMENT page (form?|other*)>
> >
> > but you can achieve what you want using:
> >
> > <!ELEMENT page (other*|form?|other*)>
> >
> > i think you missed this for exactly the reason
> > i think it should not be used.

> > Eric.



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

Reply via email to