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

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 ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    48

    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.

    BR!
    Pingz
    --------------------------------------------------------
    Newbie
    C/C#/C++
    swimming/cycling/running
    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
    Location
    Portugal
    Posts
    7,412
    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.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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
    Posts
    287
    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 Cprogramming.com
    Replies: 0
    Last Post: 10-08-2001, 02:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21