473,387 Members | 1,650 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,387 software developers and data experts.

Specify Constraints in XSD

I am trying to find the correct way to create xsd files that include
constraints such as min and max values, etc. My current xsd file looks like
the example below (just an excerpt) but the <xs:restrictions... tag is
flagged as an error. I took that syntax from the sample in the Help files
(also shown below)

What is the correct way to do this

Wayne

========== My Current XSD Format =========
<xs:element name="eqpvoc" type="xs:decimal" minOccurs="1" maxOccurs="1"
msdata:Ordinal="0" />

<xs:restriction base="xs:nonNegativeInteger">

<xs:maxInclusive value="100"/>

</xs:restriction>
========== Samples from Help =============
<xs:simpleType name="freezeboilrangeInteger">
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
Nov 12 '05 #1
1 1188
I think I figured it out:

<xs:element name="eqpvoc" type="xs:decimal" minOccurs="1" maxOccurs="1"
msdata:Ordinal="0">

<xs:simpleType>

<xs:restriction base="xs:decimal">

<xs:maxInclusive value="10.0"/>

</xs:restriction>

</xs:simpleType>

</xs:element>

Wayne

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:uJ**************@TK2MSFTNGP11.phx.gbl...
I am trying to find the correct way to create xsd files that include
constraints such as min and max values, etc. My current xsd file looks like the example below (just an excerpt) but the <xs:restrictions... tag is
flagged as an error. I took that syntax from the sample in the Help files
(also shown below)

What is the correct way to do this

Wayne

========== My Current XSD Format =========
<xs:element name="eqpvoc" type="xs:decimal" minOccurs="1" maxOccurs="1"
msdata:Ordinal="0" />

<xs:restriction base="xs:nonNegativeInteger">

<xs:maxInclusive value="100"/>

</xs:restriction>
========== Samples from Help =============
<xs:simpleType name="freezeboilrangeInteger">
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>

Nov 12 '05 #2

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

Similar topics

0
by: Morten Gulbrandsen | last post by:
Dear MySQL developers, Could some experienced Database developer please take a look at this ? It is supposed to be plain SQL2. How can it be coded under MySQL Especially all referential...
0
by: Morten Gulbrandsen | last post by:
Hi Programmers, after this legal statement ALTER TABLE EMPLOYEE TYPE =3D InnoDB; I get=20 Warnings: 0 =20 and still MySQL claims to have to use Type =3D MyISAM,
0
by: Olaf Meyer | last post by:
I'm wondering if I can also express uniquness constraints on attributes of objects that I have referenced from somewhere else. To be a bit more precise here a short and simple XML document. The...
1
by: scooterm | last post by:
### Background In it is possible to specify any special and arbitrary directory (or set of directories) to use as a source for custom, user-designed modules. For example, one can do: ###...
10
by: serge | last post by:
I am doing a little research on Google about this topic and I ran into this thread: ...
1
by: Bob | last post by:
Hi, Does anyone know why forgein key constraints are not enforced when updateing multiple tables using a combination of views and rules? This doesn't seem to be a major problem as I can...
11
by: andrew queisser | last post by:
I've read some material on the upcoming Generics for C#. I've seen two types of syntax used for constraints: - direct specification of the interface in the angle brackets - where clauses I...
8
by: wespvp | last post by:
I am using PostgreSQL 7.4.1 on RedHat 7.2. The query I am executing is something like (I replaced all the return values with 'count'): db=> explain select count(*) from messages m join (select...
4
by: Ian Lazarus | last post by:
Why are constraints needed? In C++, an attempt to use a non-existing method will cause a compiler error. Isn't that true in C# also?
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.