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

  • Home
  • SEARCH
  • 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 7597025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:04:02+00:00 2026-05-30T22:04:02+00:00

I want to export objects to XML and create XSD. following are the base

  • 0

I want to export objects to XML and create XSD. following are the base classes

class Owner
{
    private int id;
    private string name;
    private List<Car> cars;
    private int age;
}

class CarTemplate
{
    private int drive;
    private double engineCc;
}

class Car
{
    private int id;
    private string name;
    private double cost;
    private CarTemplate template;
}

Following is the modified structure that I want to export to XML and create XSD out of it

class ExportedOwner
{
    private int id;
    private string name;
    private List<Car> cars;
}

class ExportedCar
{
    private string name;
    private double cost;
    private CarTemplate template;
}

The structure of XML should be in following format

<?xml version="1.0" encoding="utf-8" ?>
<Owner>
    <id>1</id>
    <Name>John</Name>
    <Age>49</Age>
    <Cars>
        <Car>
            <id>1</id>
            <Name>Merc Class C</Name>
            <CarTemplate>
                <drive>2</drive>
                <engineCc>2500</engineCc>
            </CarTemplate>
        </Car>
        <Car>
            <id>2</id>
            <Name>Merc Class M</Name>
            <CarTemplate>
                <drive>4</drive>
                <engineCc>2900</engineCc>
            </CarTemplate>
        </Car>
    </Cars>
</Owner>

How can I create XSD for the XML format. I want XSD for importing the XML file back into the appication.

  • 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-30T22:04:03+00:00Added an answer on May 30, 2026 at 10:04 pm

    There’s 2 distinct questions to answer here…

    First, how to export your objects to an XML file. There are many ways to do this in .NET. The two most common (XmlSerializer and DataContractSerializer) are compared side by side in this blog post.

    The second part of your question is a little more broad. Generating an xsd schema from an existing XML file is not an exact science, but there are tools out there that can infer (or guess) a schema from an XML file. There are various little tools which can do this for you – it might be worth trying a few of them and seeing which one gives you best results. As always, google is your good friend 🙂

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

Sidebar

Related Questions

I want to ask you, how can I export all objects to scene to
I want to export a generic class to a generic interface via MEF. My
I want to read whatever is inside the <q:content></q:content> tags in the following xml
Why does the following throw a compiler error: class A { public: int f()
I want to export the assemblies built in my project. But where are they
I want to export the audio-media of a MOV-File with the QuickTime-API and save
Now I want to export a image in my Project to a folder ,
I am want to export database table to a file. I am using the
I have a simple report that I want to export to a CSV file.
I have a huge IQueryable that I want to export directly to Excel for

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.