Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 4 of 4

Thread: use XML or not?

  1. #1
    Registered User

    use XML or not?

    I have in ASP script that generates a press release archive, which links to the full press release content on the web. Archive's information is all saved in an XML file.

    Later, I want to develop a script that will let anyone,through a web form, to add press releases, rather than me constantly having to code each press release.

    I know it's possible to write to XML files externally, but I would like to get people's opinion who has more experience with web development, if my approach to creating this entire archive is okay, or should I use an actual database to handle this kind of work.

    I'm a designer, which is why my knowledge of web development is limited.

  2. #2

  3. #3
    Registered User
    Quote Originally Posted by bwh2 View Post
    a DB is the better option in my opinion. but XML would still work.
    may ask what makes a DB better, in your opinion?

  4. #4
    a DB's structure is more flexible going forward. in short...

    data is more accessible in a DB because querying a database is easier (and faster) than parsing an XML file. let's say you want to know how many press releases user X has added. with a DB, that's one query and would take 2 seconds. but with XML, you need to parse it and then hard code your counter in a separate language. querying a DB is just faster and easier, making the data more accessible.

    DB's are also more flexible in terms of adding or removing content. in a DB, you could just insert a column and/or separate tables. with an XML file, you would need to rewrite the entire file to account for the newly added tag.

    DB's make your audit trail easier as well. so if your users have the ability to add their own press releases, you would want to record things like who added it, when, etc. but you don't necessarily want or need that information publicly available. with a DB, that's easy because you just don't output those columns/table data. with XML, that can be more tricky because the file is sitting out in the public domain. so you would have to write separate XML files to contain that data. then things get messy.

    DB's are also better about managing permissions. so with a DB, it's easier to decide who can do what - like who can add a press release, who can edit one, who can delete one, etc. with XML, you would need to hard code that into the web app (PHP, ASP, whatever) or a separate XML file. of course, then you also have to manage who has permission to access the permissions XML file. DB's are a cleaner solution.

    also, with a DB, it's easier to account for some user input error. but if an XML file doesn't parse correctly or follow the schema, you've got problems.

    like i said, XML will work but in my opinion a DB would be better.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012