[kdewebdev-webdeveloper] test

Andrew Lowe andrew.lowe at manildra.com.au
Mon Mar 3 23:09:19 EST 2008


On Tue, 4 Mar 2008 14:50:55 Chris Martin wrote:
> Andrew Lowe wrote:
> > Articles should come out of a database quicker then an XML file, because
> > databases are optimised for this task, whereas XML is optimised for
> > making the data human readable.
>
> This actually depends greatly on the site and the server(s). There are
> plenty of cases where a simple xml file is fine, and a database would be
> overkill.
> IIRC, the kdewebdev.org site itself uses plain xml for the FAQ.
>
> Either way Isaak, Andrew is correct. You'll want to use PHP (or other
> server side language) to generate your content dynamically.

The biggest problem with the XML is it does not scale well, as your file gets 
bigger, and traffic increases, you will find the site slow down more rapidly 
then if you used a database.  
I got the impression the original question was trying to eliminate server-side 
scripting because of performance issues, which is why I highlighted this 
issue.
For a low volume traffic site, with not too much content, an XML file would be 
fine, and have the benefit of being editable in a text editor, not dealing 
with a database.

You could also just use an include file with the data pre-formatted if you are 
just dumping it into the html file - eg:

index.php:
<html>
<body>
<!-- Some heading and layout -->
<?php include('content.html'); ?>
<!-- Some footer and layout -->
</body>
</html>

content.html:
<div class="article">
 <h3>Title</h3>
  <span class="articalBody">Some text for the article</span>
</div>
<div class="article">
 <h3>Title 2</h3>
  <span class="articalBody">Some text for the second article</span>
</div>
<div class="article">
 <h3>Title 3</h3>
  <span class="articalBody">Some text for the third article</span>
</div>

This could make editing articles much easier... and is xml-like... but still 
html rendered...  Using css you can change the layout very easily

Hope this helps

-- 
Andrew Lowe
    System Administrator & Programmer
        Information Technology
            Manildra Group

Email:   andrew.lowe at manildra.com.au
Phone:   02 4423 8270
Mobile:  04 1323 8270
Fax:     02 4421 7760 


More information about the kdewebdev-webdeveloper mailing list