0

Im making a small xsd/xml file for a restaurant based system.

Here is the code that i have for my XSD file:

<xs:element name="table_cat">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="category" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence maxOccurs="unbounded">
              <xs:element name="category_id" type="CatID" />
              <xs:element name="catdescription" type="Length50"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>

    <xs:unique name="unique-catid">
      <xs:selector xpath="category" />
      <xs:field xpath="category_id"/>

    </xs:unique>

  </xs:element>

but whenever i have more than 1 Category_ID field in the XML file i keep getting the following error:

The field 'category_id' is expecting at the most one value.

Ive tried different solutions to make it work but nothing seems to work.

Hope you can help Thanks!

Edited by tukky

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Anark10n
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.