How to organize XML files and difference to Database

I'm trying to learn XML and use it on a site with many articles that can be modified after being created.

1) Should I have a folder in my site to save all the articles, one article per XML file, or should I put all the articles in a single XML file?

2) Is it faster or better to save the information for the articles in a database or in an XML file?

You see, every article is going to have different parts (paragraphs, images, etc.) and any part can be modified or deleted, and more parts can be added to the article at any time (For the images, I'm just going to save the URL and save the image in a folder).
LVL 1
cindyrodAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkmyoungCommented:
This really depends on the size of your articles, and the number of articles you intend to have.

Knowing nothing else, I'd recommend one xml file per article; benefits:
Easier to load/save a single article, instead of all the articles.
Easy to modify a single article without changing anything else.

Disadvantages:
Harder to search through; however, you could overcome this with indexes.

Would you have an xml directory file pointing to the rest of these articles?

2) A large benefit of XML to Databases is the embedded structure of xml, which automatically implies relationships between parts and parent elements. eg paragraphs and images are tied to an article by the file structure instead of having to have a table to layout all the relationships.
Furthermore, an article in XML is more easily converted to an HTML page, perhaps through XSLT or other methods.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cindyrodAuthor Commented:
1) I guess I can have an xml directory file pointing to the articles, how would I do that? Is it just an XML file with the ID of all the articles or is it some kind of special XML file?

2) Would you recommed to just load the XML file with XSLT to display it correctly or would it be better to parse through the file and display it using a server side language? (Does this make sense?)

THANK YOU SO MUCH FOR YOUR HELP!!
jkmyoungCommented:
1) I was originally thinking of just an xml file with the id's. It really depends on what you want to do with your articles, eg, if you wanted to have a quick rss like summary of your articles. This need not even be in xml format.

2) If there are going to be many views of this page, I recommend converting the page on the server. You can store the result of converting the xml to html.
So when someone requests the page, you can check the dates of the result file and the xml file, and only re-run the transformation when necessary.

Hope this helps.
cindyrodAuthor Commented:
Thank you so much for your help. That was exactly what I needed to know. THANKS!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.