in reply to Re^2: XML::LibXML expand_entities always expands entities
in thread XML::LibXML expand_entities always expands entities

This may or may not be any help but I do something somewhat related. I decode all the safe entities in HTML before parsing it with XML::LibXML. Along these lines-

use HTML::Entities; our %Charmap = %HTML::Entities::entity2char; delete @Charmap{qw( amp lt gt quot apos )}; HTML::Entities::_decode_entities($html, \%Charmap);

You would then have something closer up front for comparing. Maybe. They're both processed data but at least you'd know they processed the same.

Replies are listed 'Best First'.
Re^4: XML::LibXML expand_entities always expands entities
by shamu (Acolyte) on May 16, 2008 at 20:40 UTC
    Thanks Mom. :)
Re^4: XML::LibXML expand_entities always expands entities
by Anonymous Monk on Feb 28, 2011 at 17:12 UTC
    well, I'm afraid the solution is not sufficient, since the original document can contain some entities decoded and some not. Your solution will decode all possible entities. Is there some other way how to preserve entities in state as they were in the original document?