XML, XSL, and XHTML - some basic questions
Posted: Tue Jun 20, 2006 7:35 am
So.... I've been reading this: http://www.tonymarston.net/xml-xsl/reusable-xsl.html and wondering whether I can use it in what I'm doing. The idea sounds great, so I've done a bit of research, and now I understand what XML is, I undertand how to transform it using XSL stylesheets, and to therefore produce XHTML. I also understand that this can be done either on the client-side, or on the server-side.
So... the basics I understand.
The part I'm lacking is the integration with PHP. Let's suppose I have a database which contains data for a forum, like this one. So, I need to basically display various screens which are quite similar - one could be a list of forums, another would be the list of threads within the forum, another could be the list of posts in the thread. These pages are all essentially the same, in that the priciple data is displayed in a tabulated list.
I would usually do this by querying the database, returning a result set and Echoing the results to the page in a foreach loop. The downside to this, is that I end up repeating this kind of code for all "similar" pages, which makes coding the pages a laborious process.
At a basic level, what do I need to do in PHP? Do I need to create an XML document containing data from the database every time the page is opened? Have I misunderstood totally? Once I've got the XML document, I'm fine - I know what to do with it. It's just that area between PHP and the XML document that I don't understand...
If someone would be so kind as to give me a quick overview of what needs to happen, I'd be very grateful.
Thanks,
GM
So... the basics I understand.
The part I'm lacking is the integration with PHP. Let's suppose I have a database which contains data for a forum, like this one. So, I need to basically display various screens which are quite similar - one could be a list of forums, another would be the list of threads within the forum, another could be the list of posts in the thread. These pages are all essentially the same, in that the priciple data is displayed in a tabulated list.
I would usually do this by querying the database, returning a result set and Echoing the results to the page in a foreach loop. The downside to this, is that I end up repeating this kind of code for all "similar" pages, which makes coding the pages a laborious process.
At a basic level, what do I need to do in PHP? Do I need to create an XML document containing data from the database every time the page is opened? Have I misunderstood totally? Once I've got the XML document, I'm fine - I know what to do with it. It's just that area between PHP and the XML document that I don't understand...
If someone would be so kind as to give me a quick overview of what needs to happen, I'd be very grateful.
Thanks,
GM