So I have a list of tag, and I want to check how many of these tags are there in XML file also, and I want to get the respective line number so that I can mark those lines and show them on my UI side. I went to read the documentation of lxml but I couldn't understand it well and I am still stuck on the problem, I am not able to even start the code.
Take this for example:
<domain type='kmc' id='007'>
<name>virtual bug</name>
<uuid>66523dfdf555dfd</uuid>
<os>
<type>hvm</type>
<boot>Windows</boot>
</os>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>270336</currentMemory>
<vcpu placement='static'>10</vcpu>
Let's say I want to search for
['name','boot']
I want to process it line by line. How do I do this ?
I am interested in tag values e.g <something>Value<something>
, and I want to know all <something>
with their line numbers. Thanks