I have multiple XML documents to parse, all with the same Element names but each document has it's own unique namespace.
How do I extract the namespace on its own, so I can include it as a prefix for my "findall" loops?
For example, here's one of XML files...
<ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
<ColorCorrection id="af/af-123/neutral">
<SOPNode>
<Slope>2 1 1</Slope>
<Offset>0 0 0</Offset>
<Power>1 1 1</Power>
</SOPNode>
<SATNode>
<Saturation>1</Saturation>
</SATNode>
</ColorCorrection>
<ColorCorrection id="af/af-123/beauty">
<SOPNode>
<Slope>1.5 1.2 0.9</Slope>
<Offset>0 0 0</Offset>
<Power>1 1 1</Power>
</SOPNode>
<SATNode>
<Saturation>0.8</Saturation>
</SATNode>
</ColorCorrection>
Here's example code to start...
import xml.etree.ElementTree as ET
tree = ET.parse(file)
root = tree.getroot()
for elem in root.findall("ColorCorrection"):
# the above won't find anything,
# as I need specify "{urn:ASC:CDL:v1.2}" as prefix.
# how can I GET "{urn:ASC:CDL:v1.2}" into a variable?