0

I’m looking for a tool that can automatically generate strong types out of my W3C compliant XSD file and preserve the full-fidelity. I’m flexible to use Java or C#. I’ve tried with both JAXB and XSD.exe, but when processing a SimpleType as well as the more complex type definitions such as AttributeGroup, ComplexType, etc. the contained business logic gets lost. I’ve also not found an automatic solution for handling idioms and collections, operators with types, as well as the local definitions.

Does anyone know of such a tool?

Nir Alfasi
  • 53,191
  • 11
  • 86
  • 129
Eric
  • 1
  • 1
  • Can you be more specific on the reasons xsd.exe or other standard tools are not good enough? What sort of 'contained business logic' is in the XSD to get lost? If there is no tool from MS that is appropriate then the common approach is to write a Visual Studio extension. This will allow you include XSDs in your project that are automatically code-genned into what you need. Google 'visual studio extensions XML' or similar. – Brian O''Byrne Jun 10 '13 at 14:55
  • I'm dealing with complex Schemas, for example containing SimpleTypes (IBAN reference) as in the ISO20022 Schema Pain.001.001.04.xsd When processing a simple string is generated and the business-relevant information held in the xs:pattern data goes lost. I do not want to do manual work around coding. – Eric Jun 12 '13 at 11:06
  • I dont know enough about the tools space to be able to point you towards tools that will preserve all aspects of an XSD including restrictions and patterns. There is a good selection of Visual Studio add-ins out there. If you dont find anything then dont rule out writing your own VS add-in. Writing a code generator using either T4 or CodeDOM is not that difficult. – Brian O''Byrne Jun 12 '13 at 11:57

1 Answers1

0

XSD2Code is the best (free) tool you could find out there: http://xsd2code.codeplex.com. However, in agreement with Brian, can you provide further details?

gtonic
  • 2,295
  • 1
  • 24
  • 32
  • 1
    I checked XSD2Code, same problem as mentioned above. Someone told me to checkout Jet Messaging Technologies, I'm verifying with them now. – Eric Jun 12 '13 at 11:15
  • I see. [Here, down in the second last comment] (http://stackoverflow.com/questions/386155/comparison-of-xsd-codegenerators-c), they mention that Linq2XSD would take care of xs:pattern restrictions. – gtonic Jun 12 '13 at 12:00