Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 5th, 2007, 11:55 AM
Robert Mago
Guest
 
Posts: n/a
Default 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:complexType name="condition">
...
<xs:sequence maxOccurs="unbounded">
...
<xs:element name="condition">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="value"/>
</xs:sequence>
<xs:attribute name="operator" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Contain"/>
<xs:enumeration value="Does not contain"/>
<xs:enumeration value="Is in"/>
<xs:enumeration value="Is not in"/>
<xs:enumeration value="Equal"/>
<xs:enumeration value="Not equal"/>
<xs:enumeration value="Greater"/>
<xs:enumeration value="Smaller"/>
</xs:restriction>


  #2  
Old March 5th, 2007, 07:05 PM
John Saunders
Guest
 
Posts: n/a
Default Re: Load the restrictions from a schema

"Robert Mago" <robert@mago.comwrote in message
news:ujlBErxXHHA.1216@TK2MSFTNGP03.phx.gbl...
Quote:
>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.Schema.XmlSchema.Read. You can then
process the schema any way you like.

John


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles