I have an XML that looks like this (simplified):
<file id="file-10">
<clip>1</clip>
<timecode>1:00:00:00</timecode>
</file>
<file id="file-11">
<clip>2</clip>
<timecode>2:00:00:00</timecode>
</file>
I'm trying to use ElementTree to search for a file element with a particular id attribute. This works:
correctfile = root.find('file[@id="file-10"]')
This does not:
fileid = 'file-10'
correctfile = root.find('file[@id=fileid]')
I get:
SyntaxError: invalid predicate
Is that a limitation of ElementTree? Should I be using something else?