Thread: What's the best way to parse XML Schema with C# Language.

  1. #1
    Registered User
    Join Date
    Mar 2009

    Question What's the best way to parse XML Schema with C# Language.

    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.

    There is nothing more powerful than an idea.
    Except for an idea put into action.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    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.

  3. #3
    Registered User
    Join Date
    Jan 2008
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's wrong with C++ as a first language?
    By Angie in forum C++ Programming
    Replies: 43
    Last Post: 09-20-2009, 10:39 PM
  2. Replies: 15
    Last Post: 08-09-2009, 11:20 AM
  3. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. Visual J#
    By mfc2themax in forum A Brief History of
    Replies: 0
    Last Post: 10-08-2001, 02:41 PM