- From: Ciprian Ciubotariu <cheepeero@msn.com>
- Date: Thu, 5 Aug 2004 18:35:18 +0300
- To: xmlschema-dev@w3.org
Again, thanks. Especially for the links. It seems, however, that making normatives on such constraints optional creates in real life such DTDs. Worse, they may be controlled by higher authorities. The excerpt I gave is indeed from a real DTD, given to us by our contractor. Unfortunately leaving up to tool implementors whether to check such rules leaves plenty of space for errors. And the holes show up later, when the documents have to be interpreted by turing machines, costs are too big to remedy the situtation etc. etc.... But this is not the place for flame wars, right? :) Humbly yours, Cipi P.S. I just noticed the .ro suffix on your e-mail address... well, best regards from Timisoara :) "George Cristian Bina" <george@sync.ro> wrote in message news:411245BC.10905@sync.ro... > > Hi Ciprian, > > Actually your DTD is not valid, see [1] > > <quote > source="http://www.w3.org/TR/2004/REC-xml-20040204/#sec-element-content"> > For compatibility, it is an error if the content model allows an > element to match more than one occurrence of an element type in the > content model. For more information, see E Deterministic Content Models. > </quote> > > and further [2] > > However, as Tim Bray notes [3] in his annotated XML specification [4] > this rule will not generally be checked by XML processors. > > In general the solution is to write the DTD so that it is deterministic, > in your case the grammar accepts: > STOCKS > STOCKS, PRICE > STOCKS, STOCKS, PRICE > ... > KIT, STOCKS > > You can write it as > (KIT, STOCKS) | (STOCKS+, Price?) > > [1] http://www.w3.org/TR/2004/REC-xml-20040204/#sec-element-content > [2] http://www.w3.org/TR/2004/REC-xml-20040204/#determinism > [3] http://www.xml.com/axml/notes/Determinism.html > [4] http://www.xml.com/axml/testaxml.htm > > Best Regards, > George > ----------------------------------------------- > George Cristian Bina > <oXygen/> XML Editor & XSLT Editor/Debugger > http://www.oxygenxml.com > > > Ciprian Ciubotariu wrote: > > Should I also understand that DTDs are not fully convertible to XML schemas? > > Here's an excerpt of a DTD: > > > > <!ELEMENT ... ((KIT? , STOCKS) | (STOCKS+ , PRICE , ...)) > > > > and here is an excerpt of the XSD generated with oXygen (I found it in your > > signature) > > > > <xs:choice> > > <xs:sequence> > > <xs:element minOccurs="0" ref="KIT"/> > > <xs:element ref="STOCKS"/> > > </xs:sequence> > > <xs:sequence> > > <xs:element maxOccurs="unbounded" ref="STOCKS"/> > > .... > > </xs:sequence> > > </xs:choice> > > > > As you can see, it is almost the same situation as above. Or is it that the > > DTD is not valid? oXygen says it is valid, and I have no further knowledge > > on this issue. As a regular expression it is very valid (at least imo) > > > > Regards, > > > > Cipi > > > > "George Cristian Bina" <george@sync.ro> wrote in message > > news:41121214.90003@sync.ro... > > > >>Hi Ciprian, > >> > >> > I planned to use the following in a schema: inside an <choice> group > >>having > >> > several elements with the same name but different types. Can I write > >>this in > >> > a schema? > >>[...] > >> > 1. Is this construction allowed by the W3C schema specifications? > >> > >>No, you cannot do this in a W3C XML Schema. > >>See http://www.w3.org/TR/xmlschema-1/#cos-element-consistent for details. > >> > >>Best Regards, > >>George > >>----------------------------------------------- > >>George Cristian Bina > >><oXygen/> XML Editor & XSLT Editor/Debugger > >>http://www.oxygenxml.com > >> > >> > > > > > > > >
Received on Thursday, 5 August 2004 11:33:30 UTC