XsdTidy

A refactoring tool to overcome some limitations of the exceptional Xsd.exe tool
Download

XsdTidy Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Jonathan de Halleux
  • Publisher web site:
  • http://www.codeproject.com/Members/Jonathan-de-Halleux
  • Operating Systems:
  • Windows All
  • File Size:
  • 18 KB

XsdTidy Tags


XsdTidy Description

XsdTidy was developed to be a refactoring tool to overcome some silly limitations of the exceptional Xsd.exe tool provided with the .NET framework. More specifically, XsdTidy addresses the following problems:- Name normalization: if your XSD schema is using lower case names or more generally non ".NET" normalized names, you will end up with types that will make the FxCop spit out hundreds of infractions. - Fixed Array Sizes: xsd.exe handles multiple elements by creating an array. There is no problem when you are loading the data, but unfortunately this is not convenient if you want to populate a document since arrays do not support Add or Remove. XsdTidy uses ArrayList for more flexibility. - Default Constructor: Xsd.exe does not care about providing a default constructor that initializes the fields with the proper values. This work can become very silly when the object structure is getting big. XsdTidy achieves refactoring by recreating new classes for each type exported by the Xsd.exe tool using the System.Reflection.Emit namespace. It also takes care of "transferring" the Xml.Serialization attributes to the factored classes. Hence, the factored classes are more .NET-ish and still outputs the same XML. Moreover, there is no dependency between the refactored code and the original code.The .NET standards define specific naming convention for all types of data: arguments should be camel case, function names capitalized, etc... This is really helpful to keep the framework consistent. Tools like FxCop help us stay on the "normalized" side.This problem is tackled the dumb way: given a dictionary of "common" words, the class NameConformer tries to split a name in separate words, after that it renders it to the needed convention.There is much room for improvement on the list of words and the algorithm to split the name, any contribution welcome.


XsdTidy Related Software