Good day,
I am using BeautifulSoup to parse an XML file which has a tag like the sample below which contains some binary data:
<data length=1234 encoding="x-modified">
:M\ANEG9&3I6%1I8CN!68<ID(E]*%N]Y/J;:6EYM6&N:9<E9).YA*I:94*]9O.[Y
R;59Z0LEWY;74*:E!5YWM8KE[AE;48:5N"I74*:H(E#L79X57ZG1'E:85=YVE68,
:3=5=:B&FVN-Y(EU;UJ:*28FSQ#F6,ID'V:EE-JVN=APE:9X&8EYFL<67TI$DBR0
........
</data>
The tag, attributes and binary data is read all wrong as below:
<data>1234 encoding="x-modified">
:M\ANEG93I6%1I8CN!68<ID>(E]*%N]Y/J;:6EYM6<E9>).YA*I:94*]9O.[Y
R;59Z0LEWY;74*:E!5YWM8KE[AE;48:5N"I74*:H(E#L79X57ZG1'E:85=YVE68,
:3=5=:B(EU;UJ:*28FSQ#F6,ID'V:EE-JVN=APE:9X8EYFL</E9></ID></data>
Note how the data is truncated when a '<' is encountered in the data. Also note that the attribute 'length' is removed when the tag is read.
Any ideas how I can work around this are appreciated.
Thank you.