Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to read comment before the root element of xml python

>>> from lxml import etree
>>> tree = etree.parse('filename.xml')
>>> root = tree.getroot()
>>> print root.getprevious()
<!--Comment 1-->
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #comment #root #element #xml #python
ADD COMMENT
Topic
Name
9+8 =