[schemas] non-deterministic content model avoidance

Discussion in 'XML' started by Philippe Poulard, Sep 7, 2004.

  1. 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
    --
    Cordialement,

    ///
    (. .)
    -----ooO--(_)--Ooo-----
    | Philippe Poulard |
    -----------------------
     
    Philippe Poulard, Sep 7, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    470
  2. Douglas Alan

    Spam avoidance

    Douglas Alan, Mar 21, 2006, in forum: Python
    Replies:
    4
    Views:
    329
    Neil Schemenauer
    Mar 22, 2006
  3. Frank Cisco

    Most efficient null avoidance

    Frank Cisco, Aug 11, 2009, in forum: Java
    Replies:
    4
    Views:
    457
    Daniel Pitts
    Aug 13, 2009
  4. Barry
    Replies:
    4
    Views:
    389
    Daniel Pitts
    Sep 2, 2009
  5. Dave Anderson

    HTTP_REFERER avoidance?

    Dave Anderson, Apr 20, 2004, in forum: ASP General
    Replies:
    2
    Views:
    174
    Dave Anderson
    Apr 21, 2004
Loading...

Share This Page