non deterministic schema problem

Discussion in 'XML' started by c_capatana@hotmail.com, Nov 4, 2003.

  1. Guest

    Hello!
    I have a problem with a schema. I don't know what i can do in a
    simple way.
    I have a message in a file text. I describe its structure using xml
    schema.

    <xs:complexType name="MyMessageType">
    <xs:complexContent>
    <xs:extension base="sg:FieldsType">
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="field1" type="skt:field1type"/>
    <xs:element name="field2" type="skt:field2type" minOccurs="0"/>
    ..
    ..
    <xs:element name="fieldn" type="skt:fieldntype"/>
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="fieldx" type="skt:fieldxtype"
    minOccurs="0"/>
    <xs:element name="field1" type="skt:field1type" />
    </xs:sequence>
    <xs:element name="fieldx" type="skt:fieldxtype"
    minOccurs="0"/>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>

    An error appear when i declared both fieldx optionals (minOccurs="0).
    I have a separate file with the all the fields description.
    I need this schema for a message captured in a text file in which the
    fields order is very important and the same status characteristic
    (optional or required) to be declared in this way.

    Can you help me? Or suggest something. I don't want to complicate
    things too much because I'm new in xml.

    Thanks.
     
    , Nov 4, 2003
    #1
    1. Advertising

  2. In article <>,
    <> wrote:

    > <xs:sequence maxOccurs="unbounded">
    > <xs:element name="field1" type="skt:field1type"/>
    > <xs:element name="field2" type="skt:field2type" minOccurs="0"/>
    > ..
    > ..
    > <xs:element name="fieldn" type="skt:fieldntype"/>
    > <xs:sequence maxOccurs="unbounded">
    > <xs:element name="fieldx" type="skt:fieldxtype" minOccurs="0"/>
    > <xs:element name="field1" type="skt:field1type" />
    > </xs:sequence>
    > <xs:element name="fieldx" type="skt:fieldxtype" minOccurs="0"/>
    > </xs:sequence>


    If I understand correctly, after fieldn you want

    (fieldx?, field1)+, fieldx?

    That appears to match the same sequences as

    fieldx?, (field1, fieldx?)+

    which is deterministic.

    -- Richard
    --
    Spam filter: to mail me from a .com/.net site, put my surname in the headers.

    FreeBSD rules!
     
    Richard Tobin, Nov 4, 2003
    #2
    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:
    381
    Patrick TJ McPhee
    Nov 5, 2003
  2. Gijs
    Replies:
    0
    Views:
    427
  3. Philippe Poulard
    Replies:
    0
    Views:
    433
    Philippe Poulard
    Sep 7, 2004
  4. Sahatra Kumara

    Non-deterministic schema

    Sahatra Kumara, Mar 24, 2005, in forum: XML
    Replies:
    0
    Views:
    556
    Sahatra Kumara
    Mar 24, 2005
  5. Replies:
    3
    Views:
    457
Loading...

Share This Page