in reply to Perl converting some html entities when I don't want it to
This works:
use strictures; use HTML::Entities qw(decode_entities); use XML::LibXML qw(); my $xml = XML::LibXML->load_xml(string => <<'XML'); <root> <NODE id="431" text="<P align=&quot;left&quot;>Non-mortg +age&amp;nbsp;debts is yes</P>" type="DataInput" contextstri +ng="OtherPriorityDebts" group next="True" branchValue="Yes" dataDe +faultV="Yes" dataVisible="False" /> </root> XML for my $node ($xml->findnodes('//NODE')) { my $text = $node->getAttribute('text'); # <P align="left">Non-mortgage&nbsp;debts is yes</P> my $html = decode_entities $text; # <P align="left">Non-mortgage debts is yes</P> }
|
|---|