views:

156

answers:

2

Is it possible to import an XML DTD into Visual Studio in order to generate a proxy class?

I have a third party .dll that I need to interface with that is designed like an XML service. The interface into the .dll is all driven by XML inputs, and returns output as XML. The nice thing about it is that all the input and output types are well defined. The bad news is that they use DTD (Document Type Definition).

I would really like not to have to build up the XML by hand, but I only know how to use XSD files .Net

+1  A: 

Reduce the problem to one you know how to solve. DTDs and XSDs are roughly equivalent, and converters exist to convert DTDs to XSDs. You know how to work with XSDs, so you've reduced it to a solvable problem.

Welbog
+1  A: 

Visual Studio can handle converting your DTD to an XSD, at which point you could generate your proxy.

You should just be able to load your DTD into the XML designer, choose "Create Schema", and have Visual Studio infer the XSD from it.

womp
I knew that you could do this with and XML document, I just didn't realize that it would handle DTD's as well. I also never tried :/
Josh