473,405 Members | 2,421 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,405 software developers and data experts.

Restrictions/Enumerations in XSD

Hi guys
Unfortunately I'm a newbee to xml and xsd Schemes. I'm having the
following xml file:

<config >
<section name="A">
<entry key="k1" val="aaa" />
<!-- (range for 'val' = aaa|bbb|ccc-->
<entry key="k2" val ="true" />
<!-- (range for 'val' = true|false) -->
</section>
<section name="B">
<entry key="k3" val ="3" />
<!-- (range for 'val' = 1...10) -->
</section>
</ config >
Now, I'd like to create an xsd file for it.
I have no idea how to define the range for the attribute 'val'
depending on the values for the 'name' - attribute of the element
'ection' and the 'key' attribute in 'entry'
I think I have to use xsd:restriction /enumeration
But how do I express those dependencies????

I hope, I did not confuse you guys too much.
I'd be glad for any kind of help or hint how to start.
TIA
Nov 12 '05 #1
1 1252
Hi Tiana

Unfortunately, schemas don't let you do this. Fortunately, Schematron does!
Try this site:

www.schematron.com

There are at least two .NET implementations, the one I've used lets you
combine W3C schema validation and Schematron as well.

HTH

Nigel Armstrong

"TIANA" wrote:
Hi guys
Unfortunately I'm a newbee to xml and xsd Schemes. I'm having the
following xml file:

<config >
<section name="A">
<entry key="k1" val="aaa" />
<!-- (range for 'val' = aaa|bbb|ccc-->
<entry key="k2" val ="true" />
<!-- (range for 'val' = true|false) -->
</section>
<section name="B">
<entry key="k3" val ="3" />
<!-- (range for 'val' = 1...10) -->
</section>
</ config >
Now, I'd like to create an xsd file for it.
I have no idea how to define the range for the attribute 'val'
depending on the values for the 'name' - attribute of the element
'ection' and the 'key' attribute in 'entry'
I think I have to use xsd:restriction /enumeration
But how do I express those dependencies????

I hope, I did not confuse you guys too much.
I'd be glad for any kind of help or hint how to start.
TIA

Nov 12 '05 #2

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

Similar topics

0
by: Plinkerton | last post by:
I'm making an Base Class that will be inherited. In my base class, I have a public enumeration that defines a list of things I want my class to be able to do. I use it for Method input...
1
by: someone else | last post by:
I have some code that creates dynamic enumerations for use in a PropertyGrid control. This all works perfectly but the memory usage of the program increases quite quicly when viewing the...
4
by: ChrisB | last post by:
Hello: I will be creating 50+ enumerations related to a large number of classes that span a number of namespaces. I was wondering if there are any "best practices" when defining enumerations. ...
27
by: Ben Finney | last post by:
Antoon Pardon wrote: > I just downloaded your enum module for python > and played a bit with it. IMO some of the behaviour makes it less > usefull. Feedback is appreciated. I'm hoping to...
77
by: Ben Finney | last post by:
Howdy all, PEP 354: Enumerations in Python has been accepted as a draft PEP. The current version can be viewed online: <URL:http://www.python.org/peps/pep-0354.html> Here is the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.