Working with XML document type definitions in .net

2019-06-04 22:32发布

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

2条回答
仙女界的扛把子
2楼-- · 2019-06-04 22:58

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.

查看更多
对你真心纯属浪费
3楼-- · 2019-06-04 23:05

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.

查看更多
登录 后发表回答