Mandar Pande
Mandar Pande

Reputation: 12974

After parsing xml files in perl, getting special characters

I'm parsing a xml file & storing it in Database [using perl]. At the time of parsing am getting special characters like - &[quot;amp;lt;gt;]. What is the meaning of these special characters ?

Upvotes: 4

Views: 567

Answers (3)

DavidO
DavidO

Reputation: 13942

Those are html-safe / xml-safe translations of characters that wouldn't be legal embedded within the document in their bare form. >"&< are all 'special characters', with special meaning in the context of HTML and XML. Well... technically > isn't reserved, but the others are. &amp; is a 'safe' way of specifying an ampersand character without throwing grit into the gears of the XML or HTML parser.

HTML::Entities is a module that helps you to deal with them.

Upvotes: 2

snoofkin
snoofkin

Reputation: 8895

Use HTML::Entities module if you want to get their literal value (the way the HTML displays them).

For more info about entities, see this and this

Upvotes: 1

Related Questions