Best way to parse VisualStudio .csproj file using python

假如想象 提交于 2019-12-05 13:04:11

VS project files are XML. Python comes with a number of XML parsing libraries: http://docs.python.org/library/markup.html

Either of xml.parsers.expat or xml.minidom could accomplish what you describe. For processing small XML documents like VS project files, choosing among them is a matter of taste. The example code in the documentation for each should help you decide.

An elegant alternative, especially if you have many such transformations to apply, would be to use a filter object with the xml.sax API.

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