Working with XML document type definitions in .net

自作多情 提交于 2019-12-23 01:43:47

问题


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:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/682795/working-with-xml-document-type-definitions-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!