473,378 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

using <sequence> under the <choice> tag

2
Hi,
I am using the sequence tag under the choice tag. the code part of this is :
<xs:choice>
<xs:sequence>
<xs:element name="values" type="ValuesType" minOccurs="0" maxOccurs="unbounded"/>
<!-- Adding enum type for enum rules -->
<xs:element name="enum" type="EnumType" minOccurs="0"/>
</xs:sequence>
<xs:sequence>
<xs:element name="enum" type="EnumType" minOccurs="0"/>
<xs:element name="helpURL" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:choice>
The error doesn't show when I open the file. It shows when I validate the xsd. This occurs in XML Spy

while validating this xsd i am getting the following error:
Error Message:
Element 'enum' is not consistent with element 'enum'.
Error location: xs:schema / xs:complexType / xs:choice / xs:sequence / xs:element

Is there any other way to write this code.
please respond it will be helpful.

thanks
Jan 9 '08 #1
1 1877
jkmyoung
2,057 Expert 2GB
There is a problem with deciding which branch to choose.

Let's say you have a single enum element.
Do you choose the first sequence or the 2nd?

I think this might work instead:
Expand|Select|Wrap|Line Numbers
  1. <xs:choice>
  2.     <xs:sequence>
  3.         <xs:element name="values" type="ValuesType" maxOccurs="unbounded"/>
  4.         <!-- Adding enum type for enum rules -->
  5.         <xs:element name="enum" type="EnumType" minOccurs="0"/>
  6.     </xs:sequence>
  7.     <xs:sequence>
  8.         <xs:element name="enum" type="EnumType"/>
  9.         <xs:element name="helpURL" type="xs:string" minOccurs="0"/>
  10.     </xs:sequence>
  11.     <xs:sequence>
  12.         <xs:element name="helpURL" type="xs:string" minOccurs="0"/>
  13.     </xs:sequence>
  14. </xs:choice>
  15.  
Note where the minOccurs are.

Also if you could post the part of the xml you're trying to validate, it will help as well.
Jan 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Scott Brady Drummonds | last post by:
Hi, everyone, I have a program in which I need to store a series of Boolean values. A vector<bool> would be ideal. However, I'm concerned about this data structure because of Scott Meyers'...
3
by: Kimmo J?rvikangas | last post by:
Dear XML (Schema) experts, As an example I have the following schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"...
2
by: nosferatu_1_1 | last post by:
Hi, I would like to create a schema that validate the following xml: <music> <pop/> <rock/> <pop/> </music>
1
by: Busin | last post by:
How to save a valarray<bool> object in a file and how to read it back into a valarray<bool> object? Thanks!
0
by: Anders Ljusberg | last post by:
Hi! I have a problem.. I'm trying to get the XML from a dataset to conform to an XSD, but it keeps rearranging some elements. Try this schema: &lt;xs:schema id="test"...
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
1
by: Gerben Abbink | last post by:
In Relax NG, I understand all other group operators (interleave, choice, oneOrMore, zeroOrMore, optional), but what is the purpose of <group>? Can you give an example?
2
by: Aray | last post by:
I googled for it for few houres, but didn't resolve it, any hints will be thinkfull. I want to use the following XSD file to guarantee <element1is unique, but it doesn't work. The following...
31
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current browser window?...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.