PDA

View Full Version : XML... and parsing with PHP


JayStang
06-30-2006, 05:41 AM
Hey guys,

First off i'll start by saying this is my first time using XML so bear with me.

What i have developed is a Content Managment System in which clients of mine can login and make changes to there websites. Basically it just stores all the content html in a database. I developed it so that every time someone makes a change it pulls the pervious update and saves it to a backup.xml file and then posts the new change. This way just incase a client screws something up i can reference the backup.xml file and retrieve there previous changes.

Now what i'm trying to do is develop an interface where i can go in and essentially search the xml file by either "page name", "page id" or "date" and it will return all the results. Example if i enter "June 5, 2006" it will return the html content of all the pages that was modified on that date.

My xml structure is as follows:

<PAGEID>
<PAGENAME>
<DATE>
<HTMLCONTENT>
**this is the data i'm trying to retrieve**
</HTMLCONTENT>
</DATE>
</PAGENAME>
</PAGEID>

I'm not even sure if this structure is correct, but i figured it had to be nested since i'm going to be searching by more then one variable to try and retrieve "HTMLCONTENT".

What worries me is that the html code tags are going to screw up the xml tags. Also some of the html content is farily long and i'm not sure the limit of variables in php.

Any help towards this would be. Let me know if this is possible, give references, link examples, or just tell me good luck. I need all the modivation i can get for this one! :thumbsup:

Thanks,
Jamie!