Thursday 15 September 2011

python - Parsing badly formed XML with BeautifulSoup without converting tags -


Beautiful soup is very good to fix badly created XML:

  & lt; draw: image xlink: href =" image / image .png "xlink: type =" simple "xlink: show =" embed "xlink: actuate =" onLoad "/>  

This gives me:

  & lt; image actuate = "onLoad" href = "picture / Image Png "show =" embed "type =" simple "/>  

I want to keep it raw! Should not be too smart to tell the person?

After seeing the entire document properly, I saw That some namespace definitions were no longer present. After adding them, the desired behavior was over.


No comments:

Post a Comment