Pythonic way to fix broken xml

sharknet

New Member
I am working with a broken XML-RPC server, and while I have submitted a support request to have it fixed, there is a bug whereby it is reporting the bytelength of a utf-8 response as the character count, leading to the truncation of the XML I am receiving.I expect this will be fixed at some point soon, however I am currently investigating this as part of a set of tools, and really need to get it working. Currently I have monkey-patched xmlrpclib to reverse the parsing on exception and allow me to manually feed the parser a corrected version of the response, but considering the nature of XML there must be a way to do this programatically and therefore allow me to use the XML-RPC server as if it does not have this bug.The amount of truncation is only a portion of the closing tags, so if there were an inbuilt way to get the broken xml tree, dump it with all tags closed, and then parse this instead, it would allow me to get on with my work - I'm currently looking at rolling my own, but any help would be much appreciated, I can't imagine I'm the first person to ever want to perform error-correction on xml, but if I don't find a solution pre-made I'll push mine to git and link it from here.
 
Back
Top