[Home] [By Thread] [By Date] [Recent Entries]
Hi there, "Roger L. Costello" wrote: > [1] It was my understanding that the following is not allowed: > > <!ELEMENT signature (name | (name, date))> > > because it would require an XML Parser to "look-ahead" when it > encountered the <name> element to determine which choice was taken. > > I have actually tested this example with xerces and XML Spy. Both > parsers accept this. Are they erroneously accepting this? Can someone > please clarify what it means that non-deterministic content models are > not allowed in XML? Appendix E in the XML Spec ( http://www.w3.org/TR/REC-xml#determinism ) is Non-Normative. The non-determinism is mostly for SGML compatibility. So it more a 'should' than a 'must'. In most cases non-deterministic expressions can easily be translated to detemistic ones. so in your example: <!ELEMENT signature (name, (date)?)> A good DTD should do it this way. (I am currently building a XML to Java Data-Binding tool. And it happened to be a problem to translate ambiguous content models. But there are algorithms to transform them to unambiguous. Ugh! Just don't want to implement them...) Cheers Patrick begin:vcard n:Ohl;Patrick tel;cell:+49-1708607430 tel;home:+49-89-38859084 tel;work:+49-89-358680-45 x-mozilla-html:FALSE url:http://www.jNerd.de adr:;;Ainmillerstr. 6;Munich;;80801;Germany version:2.1 email;internet:Patrick.Ohl@o... fn:Patrick Ohl end:vcard
|

Cart



