Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 501135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:09:31+00:00 2026-05-13T06:09:31+00:00

Good day. I can handle a ComplexType such as: <xsd:element name=Prerequisite> <xsd:complexType> <xsd:sequence> <xsd:element

  • 0

Good day.

I can handle a ComplexType such as:

  <xsd:element name="Prerequisite">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Type" type="Prerequisite.Type.type" minOccurs="1" maxOccurs="1" />
        <xsd:element name="Miscellaneous" type="Prerequisite.Misc.type" minOccurs="0" maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

My C# like this below:

    // Get the sequence particle of the complex type.
    XmlSchemaSequence sequence = complexType.ContentTypeParticle as XmlSchemaSequence;

    if (sequence != null)
    {
        // Iterate over each XmlSchemaElement in the Items collection.
        foreach (XmlSchemaElement childElement in sequence.Items)
        {
            Console.WriteLine("Element: {0}/{1}/{2}/{3}", 
                              childElement.QualifiedName.Name,
                              childElement.SchemaTypeName.Name, 
                              childElement.MinOccurs, 
                              childElement.MaxOccurs);
        }
    }

But i don’t know how to handle the “restriction” and “enumeration”?
Could you please give me some guide. thanks in advance.

  <xsd:simpleType name="SystemTypeEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Etch" />
    </xsd:restriction>
  </xsd:simpleType>

XmlSchemaSequence -> I Can’t find the class of XmlSchemaRestriction

XmlSchemaElement -> I Can’t find the class of XmlSchemaEnumeration too.

🙁

========================= Need Further Help. THANKS. ========================

@ foreach (XmlSchemaEnumerationFacet childEnumeration in ????);

I still don’t know how to complete the top line.
Could you give me further help?

        XmlSchemaSimpleType simpleType = xsdType as XmlSchemaSimpleType;
        Console.WriteLine("simpleType: {0}", xsdType.Name);
        XmlSchemaSimpleTypeRestriction restriction = simpleType.Content as XmlSchemaSimpleTypeRestriction;

        if (restriction != null)
        {

            Console.WriteLine("restriction : {0}", restriction.BaseTypeName.Name);

            foreach (XmlSchemaEnumerationFacet childEnumeration in ????)
            {
                Console.WriteLine("Element: {0}", childEnumeration.Value);
            }
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:09:31+00:00Added an answer on May 13, 2026 at 6:09 am

    There are XmlSchemaSimpleTypeRestriction and XmlSchemaEnumerationFacet.

    The question “Extract enumeration values from xsd schema file in .net” discusses the same problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, How can I get class's property name, if I have custom attribute
Good day! How can I access this part of XML and print the element
Good Day, Can someone confirm what was said at the bottom of this post
Hi and Good day to all, Google App Script can be used in so
Good day, I want to set click event on every anchor element in my
I'm find such a gem a whole day, but not find a good one.
Good day all, I have a preset situation that can't be changed, that revolves
Good day, I need to extract portion of string which can looks like this:
Good day, i will try to explain my problem as best as i can.
Good day, Anybody knows of a good java library for retrieving mime type and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.