On Thu, 21 Mar 2002 12:31:25 +0100
"Hans Hagen" <[EMAIL PROTECTED]> wrote:

> At 11:51 AM 3/21/2002 +0100, Berend de Boer wrote:
> >Hans Hagen <[EMAIL PROTECTED]> writes:
> >
> > > 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
> >
> >Really annoying:
> >
> ><!ELEMENT one ( (a, b?, c?) | (a, c?, b?) |
> >                 (b?, a, c?) | (c?, a, b?) |
> >                 (b?, c?, a) | (c?, b?, a) )

Berend, this doesn't actually work. The XML parser cannot find the correct
branch so it considers the definition to be ambiguous when it finds alternative
2, 5 or 6 (because it has already seen 1,4 and 3 resp.)

> >Doesn't scale as you notice. SGML DTD makes this a lot easier, but XML
> >DTD is simpler. At least Relax NG supports this better AFAIK, so I
> >expect in XML Schema this is also easier.
> 
> Does this mean that the dtd is the limiting factor? Or is Relax NG not xml 
> complient?

Depends on the definition. A Relax NG document (or any kind of external 
specification except a DTD) cannot be called 'valid', since the spec
states:

  Definition: An XML document is valid if it has an associated document type 
  declaration and if the document complies with the constraints expressed in it.

But it is still XML as long as it follows the well-formedness constraint
(correct syntax and tag nesting). 


-- 
groeten,

Taco

Reply via email to