Repairing broken XML file - removing extra less-than/greater-than signs

Posted by peku on Stack Overflow See other posts from Stack Overflow or by peku
Published on 2010-03-26T08:38:31Z Indexed on 2010/03/26 8:43 UTC
Read the original article Hit count: 158

Filed under:
|

I have a large XML file which in the middle contains the following:

<ArticleName>Article 1 <START  </ArticleName>

Obviously libxml and other XML libraries can't read this because the less-than sign opens a new tag which is never closed. My question is, is there anything I can do to fix issues like this automatically (preferably in Ruby)? The solution should of course work for any field which has an error like this. Someone said SAX parsing could do the trick but I'm not sure how that would work.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about Xml