I am parsing an xml file using Python ElementTree, for example:
et = ElementTree(file=file("test.xml"))
test.xml begins with a few lines of XML comments.
Is there any way to get these comments from et?
For ElementTree 1.2.X, there is an article on Reading Processing Commands and Comments with ElementTree ( http://effbot.org/zone/element-pi.htm ).
EDIT:
An alternative would be to use lxml.etree , which implements the ElementTree API. Quote from compatibility ElementTree lxml.etree :
ElementTree XML, etree .
Source: https://habr.com/ru/post/1703090/More articles:Problems with ASP.Net Public Service - asp.netListView MouseClick Event - c #How to create a WPF path that stretches in place - wpfJavaScript function call at the end of a button click event - javascriptWhat do you think is the most abused design pattern? - designКак найти пользовательское поле ip-адреса, сохраненное как целое в Django-admin? - pythonWinAPI - how to draw a dashed line? - windowsEfficiently extract and filter files - performanceHow to speed up jquery: selected selector? - performanceКак отсортировать столбец varchar (SQL), который содержит число, символы, символы? - sqlAll Articles