in reply to Re: XML - Escaping characters from database for XML
in thread XML - Escaping characters from database for XML
With XML::LibXML, you can get away without creating a document and element...
print XML::LibXML::Text->new('<&')->toString;
It's pretty easy to wrap that up into a function:
sub escape_xml { XML::LibXML::Text->new(shift)->toString } print escape_xml('<&');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: XML - Escaping characters from database for XML
by choroba (Cardinal) on May 28, 2012 at 14:46 UTC |