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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:51:13+00:00 2026-05-13T14:51:13+00:00

I have an XSD file and I want to create an XML file at

  • 0

I have an XSD file and I want to create an XML file at runtime based on the XSD. (My question is basically the same as this one, except in the .NET world, rather than for Java.)

I have run xsd.exe /c /l:vb MyTest.xsd, but that generates a class that cannot be instantiated and used, as it has nested classes that are never instantiated. It appears that the generated class is only used for XML deserialization, but I don’t have an XML file to deserialize from.

Running xsd.exe /d /l:vb MyTest.xsd generates a dataset, but it looks like using that would be more coding than just writing out an XmlDocument manually.

What is the best way to create an XML file based on a specific schema?

  • 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-13T14:51:14+00:00Added an answer on May 13, 2026 at 2:51 pm

    It turns out I was just being obtuse. While the classes generated by xsd contain uninitialized nested classes, they are exposed via public properties, so there is nothing stopping me from instantiating them myself.

    Something like the following:

    ElementA.ElementB = New ElementB()
    ElementA.ElementB.Name = "Jason"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that I used to create an XSD File and
I have a schema (xsd), and I want to create xml files that conform
I want to write an XML file. I have created an XSD file named
I have xsd file. I want to generate my entity model from this schema
I have an xml. I have created one XSD for the xml. I want
I have one xsd file I'd rather not modify (Exceptions.xsd): <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns=http://me.com/Exceptions.xsd targetNamespace=http://me.com/Exceptions.xsd
I have this Maven task to generate Java classes from an XSD file using
I have an XML Schema Definition file .XSD who's elements are in Spanish. I
I have been provided an XSD and a sample Xml file that contains the
Possible Duplicate: How to create XSD file programmatically in C#? I have an XDocument

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.