[schemas] non-deterministic content model avoidance

Philippe Poulard

Usenet Archive
Joined
Dec 20, 2001
Messages
412
Reaction score
0
hi,

i try to design a schema language, and i encoutered the famous well-known problem :

valid documents are :
<page></page>
<page><odd/></page>
<page><odd/><even/></page>
<page><odd/><even/><odd/></page>
<page><odd/><even/><odd/><even/></page>
<page><odd/><even/><odd/><even/><odd/></page>
etc...

invalid documents are :
<page><odd/><odd/></page>
<page><odd/><even/><odd/><odd/><even/></page>
<page><odd/><even/><odd/><even/><even/></page>
<page><even/></page>

to express the constraints, we could write :
(odd, even)*, odd?
but it is invalid in DTD because of the violation of the "non-deterministic content model" rule

as you know, this problem is unresolvable because it is an unambiguous pattern which is not deterministic and can't be rewritten in a deterministic form (i picked it from the Eric's relax book)

my schema language can express such a content model (4 lines) without looking forward, but i'd like to know if :
-it is possible with W3C XML Schemas ?
-it is possible with Relax NG ?

additionally, i'd like to know whether Schematron can be used for editing purposes or not (i don't think so), that is to say if one can predict if an element is available with a given context, for example.

thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top