Posted on 2005-07-13 11:39:38-07 by purge
escaping text data
I was wondering if there was a way to automatically escape characters - XML::Twig seems to automatically do & , < , > etc, but I experienced problems when using a £ (UK pound sign, not html entity - real one). Is this a fault with the escaping mechanism, or am I just missing something?
Direct Responses: 739 | Write a response
Posted on 2005-07-14 18:35:31-07 by mjash in response to 730
Re: escaping text data
In XML these characters
[&<>"']
are called entities and those five are pre-defined to be replaced with the ampersand-semicolon escape. You can define your own entities too. You don't say how (or where) you are using the UK pound symbol but you might use CDATA rather than TEXT to avoid problems parsing business data.

-mjash
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.