Should I store HTML in XML or encode it first?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Should I store HTML in XML or encode it first?

Post by toasty2 »

I'm writing a content system that will use XML for storage. I will be storing HTML, so should I just drop the HTML into XML elements or is that a bad idea and will it affect parsing of the file using simplexml? If it will cause problems, what should I do...base64?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Should I store HTML in XML or encode it first?

Post by alex.barylski »

If memory serves me correct (I implemented an XML CMS as well) I believe it does cause problems...

I stored the XHTML code as CDATA I think -- try it and find out.
Post Reply