You shouldn't be passing XML through decode_entities. The result will be not be an well-formed XML document. Any
& entities will be turned into
& and those are must be escaped with
XML::Parser will decode entities in the XML document. The NoExpand option controls this. The standard entities will be handled automatically. If this is all you have in your document, then you don't need to worry about them.
If the XML document contains any HTML entities other than the standard three, you will need to handle those specially. The XML standard way is to declare them in a DTD either an internal DTD subset or external file. Declaring entities is one of the last uses for DTDs. Unluckily, using DTDs either in an internal subset or external file adds some complexity.
There have been some proposals to handle character entities without DTDs but none of them have been accepted.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.