locked
xsd.exe to generate code files and update schema RRS feed

  • Question

  • User1080785583 posted

    I have a .xsd file that I intend to use to generate code files. Am I able to generate this file programatically and get differences from the previous code file? 

    I want to store the code file in a database and execute wsd.exe to transform the file but I need a way to know what poco entities I must update.

    Example code file would be

    class a{

    obj 1

    obj2

    obj3

    }

    I then receive an update and it is now

    class a{ 

    obj 2

    obj 3

    obj 4

    }

    I have a schema difference report in xsd I can use but have never used this file to determine schema changes to my .xsd

    Thank you in advance.

    Sunday, September 8, 2013 5:47 PM

All replies

  • User-488622176 posted

    There is no easy way to compare XML or XSD schema's, unless your underlying schema/structure is exactly the same. In your case, you'll need to maintain more info on the classes, properties and datatypes to make the comparison.

    Why do you need this difference? Perhaps the default functionality of EF can solve your problem? 

    Monday, September 9, 2013 7:18 AM
  • User1080785583 posted

    I am hoping to use entity to update the columns accordingly. The code file may change in structure so I must keep a history of the changes to decommission a column.

    Monday, September 9, 2013 12:34 PM
  • User-488622176 posted

    You cannot exactly maintain this kind of intelligent info on code, as it is plain text without structure.

    If you need this functionality, you'll need to:

    • Build a metamodel with entities, properties, relations,...
    • Apply diff-checking on the model when it changes
    • Generate the code from this model
    Wednesday, September 11, 2013 4:39 AM