C
c_capatana
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.
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.