I'm using ElementTree to compare a CSV file to an XML document. The script should update the tags if the tag matches the first cell in the CSV. The tag needs to have a non-breaking space to prevent the text from wrapping when I import the XML into a different program (InDesign).
XML Input:
<Table_title>fatal crashes by time of day</Table_title>
<cell>data1</cell>
<cell>data2</cell>
<cell>data3</cell>
CSV input:
'fatal crashes by time of day', data1, data2, data3
However, when I read the XML into the ElementTree script using ET.parse('file.xml'), it seems to render the character a non-breaking space:
<Table_title>fatal crashes by time of day</Table_title>
<cell>data1</cell>
<cell>data2</cell>
<cell>data3</cell>
Which is exactly what it should do (I think). But in this scenario, I actually want   to render as a string, so that it matches the first cell of the CSV (because when the CSV is read in, it interprets it as a string: 'fatal crashes by time of day').
Is there a way to:
- Force the XML script to read the non-breaking space as a string instead of an escaped character:
<Table_title>fatal crashes by time of day</Table_title>
or
- Force the XML script to read the CSV and render the character as an escaped character instead of a string:
'fatal crashes by time of day', data1, data2, data3