Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: Converting HTML special entities to XML

by Aristotle (Chancellor)
on Sep 02, 2004 at 17:24 UTC ( [id://388004]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Converting HTML special entities to XML
in thread Converting HTML special entities to XML

All that is why I'm giving the recommendation that I'm giving. :-)

You can work with escaped characters avoid going through Unicode, if you wish; but it is hard to get that really right and most people don't.

That's why I assert that you should not work with the HTML directly and should not work with the XML directly. It's safest to think of HTML and XML not as a data format, but as an opaque serialization of a data structure. You ask one deserializer for the data structure, and get something unambiguous (ie, Unicode) that you can work to your heart's content with; then you give the still unambiguous result to another serializer that produces conforming output for you.

As I said, you can do it differently. Just as you can avoid using strict. It's jut much easier to not shoot yourself in the foot if you stick to that practice.

Makeshifts last the longest.

  • Comment on Re^5: Converting HTML special entities to XML

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://388004]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-19 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found