XML Validation
I just recently had to convert a DTD from UPS into an XSD as part of a Commerce Server integration project. Wanting to test my code (imagine that), I needed to validate both the XSD and sample XML against it. To create the schema I used dtd2xsd available on GotDotNet — looks like MS got stuck holding this open for a bit.
I then needed to create a couple small tools to test the output. Ok, I didn’t NEED to do it, but I love to write tools and they help me procrastinate. Anyway, after a couple of tweaks to the generated schema to solve a UPA problem I validated that the schema was valid and could be used to reliable validate the XML. The benefit of the schema is that I can generate the classes to handle this data using xsd.
If anyone is interested in the tools, they are simply two .NET 2.0 console applications that were based on samples available online. I’ve attached the binary versions to this post but if you want the code feel free to disassemble them.