Nano HE
Nano HE

Reputation: 9307

How to parse XML Schema File

Good day.

How to parse XML Schema(.xsd) file and generate to c# class file.

About my project:

Step1. Parse XSD file (C# lang) ----Build Time -----> Generate CCode Dictionary(C# Class)

Step2. Paser XML file(C# lang) ----Run Time -----> Fill the CCode Dictionary with the XML file value (C# App)

I researched the tools of XSD.exe / XSDObjectGen Tool etc. I found the C# class can't be used for my project.

That's why i want to parse the XSD file by myself. I searched MSDN and found the the information: Namespace: System.Xml.Schema But i don't know which class if better for me for using.

Any help will be appreciated.

BR! Nano

Upvotes: 0

Views: 1902

Answers (2)

marc_s
marc_s

Reputation: 754478

Or you can use the Xsd2Code command-line and Visual Studio add-in utility.

With Xsd2Code, you can right-click on a XSD file in your Visual Studio Solution Explorer and have it create the C# file for you:

alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=Xsd2Code&DownloadId=41336

Upvotes: 2

David Reis
David Reis

Reputation: 12990

In my project I successfully used xsd.exe to do this, with this command line:

xsd.exe schema.xsd /classes

What in the classes generated make them inappropriate for use in your project?

Upvotes: 1

Related Questions