Thread

Posted on Wed Jun 27 20:29:07 2007 by dbmathis
XML::Twig crashing when encountering unqouted ampersand.
I have a few mal-formed XML documents that XML::Twig is not liking too much. The XML documents contain a & outside of a CDATA tag.

Can XML::Twig ignore any unquoted character that appears outside of a CDATA tag and just throw it out when parsing or is there anything available that will pre scan the document and remove characters before XML:Twig parses the XML?

Thanks.
Direct Responses: 5560 | Write a response
Posted on Wed Jun 27 23:41:11 2007 by mirod in response to 5558
Re: XML::Twig crashing when encountering unqouted ampersand.

No, it can't.

XML::Twig is based on an XML parser, which like all XML parsers, refuses to work with mal-formed XML. It only works with XML. That is part of the XML spec. I am afraid you will have to pre-process yur data to turn it into well-formed XML before using any XML tool on it.

Write a response