473,378 Members | 1,468 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.

How to make a choice in XSD?

I'm trying to write an XML schema file (XSD) that will have two kind of
elements:
* xs:base64Binary
* xs:string

But I need that the schema will let only one of this elements to exist in
the XML (or DataSet), meaning; I wand the user to enter or byte[] array data
or a string, but not both.
When the user select one of the two elements type, he can enter as many as
he likes.

I tried the xs:choice that will hold this two elements as follow:
<xs:choice id="PictureType" minOccurs="0" maxOccurs="2">
<xs:element name="Dump">
<xs:complexType>
<xs:sequence>
<!-- Array of Byte objects -->
<xs:element name="PictuteDump" type="xs:hexBinary" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Path">
<xs:complexType>
<xs:sequence>
<!-- Full path of the picture file -->
<xs:element name="PictutePath" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>

But still it allow me to eneter both!

Note: The xs:base64Binary is for holding picture data and the string is for
holding the path of a image file saved on disk.

--------
Thanks
Sharon G.
Nov 17 '05 #1
0 1067

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
2
by: Terry Olsen | last post by:
I want to have a series of DropDownLists appear. On PageLoad, the first list is created. When I make a choice, a 2nd list is created, data loaded depending on the choice from the first list, and...
3
by: Andy | last post by:
Hello, everyone, I am writing a segment of code for listing the permutation of some event sequences. I tried to use template to make the code more general. When I commented the code as shown...
48
by: Nathan Sokalski | last post by:
Ever since I found out that they didn't give us a way to install both IE6 and IE7 on the same machine, I have been more frustrated and annoyed with Microsoft than I ever have been with any company...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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.