I need to make a parse to an XML file. I need to take time codes (Beginning and ending) and the sentence related to this times.
The XML file is something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Trans SYSTEM "trans-14.dtd">
<Trans scribe="jj" audio_filename="01" version="1" version_date="150211">
<Episode>
<Section type="report" startTime="0" endTime="50.28281021118164">
<Turn startTime="0" endTime="50.28281021118164">
<Sync time="0"/>
<Sync time="1.195"/>
Something
<Sync time="2.654"/>
Something 2
<Sync time="4.356"/>
Something 3
<Sync time="9.321"/>
Something 4
<Sync time="22.171"/>
Something 5
<Sync time="28.351"/>
Something 6
<Sync time="35.708"/>
Something 7
<Sync time="43.04"/>
Something 8
</Turn>
</Section>
</Episode>
And I need to obtain this final result:
0 1.195
1.195 2.654 Something
2.654 4.356 Something 2
4.356 9.321 Something 3
9.321 22.171 Something 4
22.171 28.351 Something 5
28.351 35.708 Something 6
35.708 43.04 Something 7
43.04 "endTime" Something 8
I'm working with Ubuntu, any suggestions? Is it posible to do this with bash?
Thank you!