473,785 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load the restrictions from a schema

I have an xml document instance in C# which loads an xml schema.

I would like to load the restrictions for a complex type in the schema so
that the user will choose one, from a drop down list for example.

Any ideas?

A stripped down schema segment is shown below:

<xs:complexTy pe name="condition ">
...
<xs:sequence maxOccurs="unbo unded">
...
<xs:element name="condition ">
<xs:complexType >
<xs:sequence maxOccurs="unbo unded">
<xs:element name="value"/>
</xs:sequence>
<xs:attribute name="operator" use="required">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:enumerati on value="Contain"/>
<xs:enumerati on value="Does not contain"/>
<xs:enumerati on value="Is in"/>
<xs:enumerati on value="Is not in"/>
<xs:enumerati on value="Equal"/>
<xs:enumerati on value="Not equal"/>
<xs:enumerati on value="Greater"/>
<xs:enumerati on value="Smaller"/>
</xs:restriction>
Mar 5 '07 #1
1 2209
"Robert Mago" <ro****@mago.co mwrote in message
news:uj******** ******@TK2MSFTN GP03.phx.gbl...
>I have an xml document instance in C# which loads an xml schema.

I would like to load the restrictions for a complex type in the schema so
that the user will choose one, from a drop down list for example.

Any ideas?
You xan load the schema with System.Xml.Sche ma.XmlSchema.Re ad. You can then
process the schema any way you like.

John
Mar 5 '07 #2

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

Similar topics

3
4846
by: ruthless | last post by:
hello. I've got a problem - can I do any restrictions for my attributes? I found how to restrict elements and was trying to use them with my attributes e.g. <person sex="F"> sex can be anly F and M i've got sth like this:
1
1254
by: Kim Lokøy | last post by:
I have the following class hierarchy / type hierarchy: A a b c The xml schema is something like this: <complexType name="A">
0
1161
by: Robin | last post by:
Hi, I have just started using xsd.exe and was wondering if anyone knows if it can deal with type restrictions. I have noticed that, when I ran xsd.exe to process a schema I have written, the class produced did not have the restrictions that were in the schema. Ta, R
2
9236
by: Shailendra Batham | last post by:
Hello Gurus, I want to put some restrictions on my attribute tag in my XML Schema, anyone out there have any idea how to do that. here is my XML and the XML Schema <?xml version="1.0" encoding="utf-8"?> <Book ID="1000000000"> <Name>XML Basic</Name> <Comments>Whatever</Comments>
0
1330
by: ruediger | last post by:
Hi there, I want to set up an XML Schema for documents of the following structure: The <root> node contains - an optional <message> element with a text attribute, and - arbitrary further content. To make the parts unique, the top-level element of the further content
5
12515
by: Dmitry Kulinich | last post by:
Guys! I've got 1 more small problem with XSD. It simple and good, but sometimes disappointing. For example we have 3 <THtags - only text and 1 attribute. Then we need <restriction>-<enumerationto set all <th>'s text values, but also <extensionto add 1 attribute How to do it simultanously inside og 1 element? Here is simple code in XSD: <xsd:element name="TH" > <xsd:complexType>
3
1677
by: Marc Hebert | last post by:
I'm trying to figure out if something is possible to specify and constrain using a schema. I'll explain using an example. sample xml: <person name="John" age="32"/> <person name="Julie" age="25"/> In my schema, I'd love to be able to place different restrictions on the attribute 'age' based on the value of 'name'... so in this example, I might want to enforce that any entry where name="John"
0
2036
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned for further use. To create the schema I am using the XMLSchema classes and the result is the
2
1421
by: jamil | last post by:
Take a look at the following XML doc: <main> <a> <element>123</element> </a> <b> <element>abc</element> </b> <c>
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.