Hello all,
Good day.
I plan to parse XML schema using C#.
But my XSD file is very complex.
What's the best way to parse the XSD file and generate a C# class file.
What can i do is using the classes of System.Xml.Schme ?
Thanks in advance.
BR!
Pingz
This is a discussion on What's the best way to parse XML Schema with C# Language. within the C# Programming forums, part of the General Programming Boards category; Hello all, Good day. I plan to parse XML schema using C#. But my XSD file is very complex. What's ...
Hello all,
Good day.
I plan to parse XML schema using C#.
But my XSD file is very complex.
What's the best way to parse the XSD file and generate a C# class file.
What can i do is using the classes of System.Xml.Schme ?
Thanks in advance.
BR!
Pingz
--------------------------------------------------------
Newbie
C/C#/C++
swimming/cycling/running
There is nothing more powerful than an idea.
Except for an idea put into action.
--------------------------------------------------------
I have to explore XML under C#. Others may have more informed opinions. But my first forays into this System.XML revealed to me a set of very raw read/write methods that end up forcing you to produce a huge amount of ugly code for anything but the simplest of parsing.
As such, I'd probably advise Linq to XML as a more elegant approach. In any case the whole document is surely worth reading.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
If you need to generate a C# class file from an XSD, there is already a tool to do so called xsd.exe, and it's provided along with the .NET framework. Google searches for "c# xsd" turn up MANY results.
If you want to do it at runtime and you don't like System.Diagnostics.Process, I would suggest opening up xsd.exe in Reflector and seeing if you can use some of its components.