I have an XMLTV file. I need to get all of the programme sections for a specific channel. An example snippet:
<programme start="2023031305000 -0400" end="2023031305300 -0400" channel="Bleah.us"
<title>This is the Title</title>
<desc>This is the Description</desc>
</programme>
Simple enough if the programme section was always 4 lines: grep -A3 channel="Bleah.us"
But the programme section may change lengths. Sometimes it may have addition sub-elements like <sub-title> and/or <category> and/or <icon>.
So my question. How do I find the lines that contains 'channel="Bleah.us"' and print that line and all of the lines until '</programme>' is found (and print that line too)? There could be 1 secion, there could be 100 sections, I won't know.
Thanks in advance!
xidel
,xmllint
orxmlstarlet