Non-deterministic schema

Discussion in 'XML' started by Sahatra Kumara, Mar 24, 2005.

  1. I have the schema that was written by other people. This schema seems
    to be wrong. Altova XML SPY 2005 and .Net have found out the block of
    schema definition that contains error, namely non-determinism.

    <xsd:complexType name="typeRequisite">
    <xsd:sequence>
    <xsd:choice>
    <xsd:group ref="edmsi:SubRequisitesGroup"/>
    <xsd:group ref="edmsi:SingleRequisiteValueGroup"/>
    </xsd:choice>
    </xsd:sequence>
    </xsd:complexType>

    <xsd:group name="SingleRequisiteValueGroup">
    <xsd:sequence>
    <xsd:element name="Value" type="xsd:anySimpleType"/>
    </xsd:sequence>
    </xsd:group>

    <xsd:group name="SubRequisitesGroup">
    <xsd:sequence>
    <xsd:element name="Value">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Requisite"
    type="edmsi:typeRequisite" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:group>

    I have listen that the processor doesn't take into account the type of
    child elements while validating. Processors pay attention only to name
    of the current element, not looking ahead. Thus I believe that it
    isn't able to determine whether complex or simple Value should be used
    at the current step without looking ahead. Really (thanks to
    xml-tools), you see it is non-determinism.

    As far as I can suppose, the following schema definition attempts to
    describe the xml that is illustrated bellow:

    <Value>
    <Value>text</Value>
    <Value>text</Value>

    <Requisite>
    <Value>text</Value>
    <Requisite>
    <Requisite>
    <Value>text</Value>
    </Requisite>
    </Requisite>
    </Requisite>

    <Value>text</Value>
    </Value>


    I tried to change this schema declaration but I can't.

    Moreover I don't want to seriously exchange this declaration because
    these types are the basic ones in my (more than 930 lines) schema and
    if I seriously change this block I will have to change everything.

    But I have no idea how to change this schema neither by cardinal nor
    by easy way.

    I have rebuilt the same declarations in Relax NG in hope of performing
    rewriting approach mentioned in Van der Vlist Relax NG book.

    requisite = element requisite { value | requisite }
    value = element value { text | ( value* & requisite* ) }

    First of all, I don't want what to do with it :)
    In the second place, «interleaved» is used, so it restrict ability to
    port the possible solution in W3C Schema world.

    Many thanks…

    --
    BTW: Put your finger on the Crux

    Regards,
    ~Sahatra Kumara~
     
    Sahatra Kumara, Mar 24, 2005
    #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:
    1
    Views:
    409
    Richard Tobin
    Nov 4, 2003
  2. Replies:
    1
    Views:
    373
    Patrick TJ McPhee
    Nov 5, 2003
  3. Gijs
    Replies:
    0
    Views:
    418
  4. Philippe Poulard
    Replies:
    0
    Views:
    421
    Philippe Poulard
    Sep 7, 2004
  5. Replies:
    3
    Views:
    441
Loading...

Share This Page