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 7970349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:23:06+00:00 2026-06-04T07:23:06+00:00

I have a question about how to use XSD Schema to validate XML format.

  • 0

I have a question about how to use XSD Schema to validate XML format.

I have already program successfully to validate XML format using XSD schema. However, I need to put the xx.xsd in main location of current project. Is there anyway to embed the xsd schema to the assembly so that I do not need to always put xxx.xsd to the same location of the executable assembly. I have tried to embed it to resources of the project, but it seems that I am not able to resgen a XSD file when using VS command prompt like this resgen xxx.xsd. It says the extension is not support by this command.

Are there any other ways to resolve this problems.

Any suggestions are appreciated.

  • 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-06-04T07:23:07+00:00Added an answer on June 4, 2026 at 7:23 am

    Step 1: Add the XSD to your class library project just as you would normally

    Step 2: Right click à properties on the XSD file, and under Build Action, choose “Embedded Resource”

    Step 3: Modify the code as shown here from

    XmlSchemaSet schemaSet = new XmlSchemaSet() ;
    schemaSet.Add("", XmlReader.Create(xmlSchema));
    

    to

    TextReader schemaStream =
        new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(xmlSchema));
    XmlSchemaSet schemaSet = new XmlSchemaSet() ;
    schemaSet.Add("",XmlReader.Create(schemaStream));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about the use of multidimensional std::intializer_list in C++. I have
I have a question about the use of data structures such as ArrayLists in
Recently I have asked a question about what I should use to create self-contained
I'm new to OOD so I have a question about the use of classes
i have question about why should we use return in get,if dont use what
I have a question about combobox.I use visual c# and I want to insert
I have a design question about the use of Hibernate annotations and DAO pattern.
I have a question about the use off the http api from the company
I have a question about assert() in Linux: can I use it in the
I have a question about PHP sessions. I use a session to keep a

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.