SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: XML..... Why?

  1. #1
    SitePoint Wizard wdmny's Avatar
    Join Date
    Jul 2000
    Location
    Here
    Posts
    1,010
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know there is a lot of hype over XML and all but I personally see no point in it. From what I see, it seems that we already have something that achieves the same task behind custom tags and thats CSS. Would anyone like to add to this about why to use XML and why not?

  2. #2
    SitePoint Member
    Join Date
    May 2001
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well everyone is entitled to have their own opinion.

    Xml involves much more than what you have mentioned. I suggest you check out the following sites. There quiet a lot of info on Xml and why it is supposed to be good. www.w3.org/ and www.ucc.ie/xml

  3. #3
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XML is God's gift to poor web programmers everywhere.

    Of course its not too useful if you serve it up like HTML, which seems to be what you are thinking about, but on the server side the possibilities are endless.

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thinking about XML only in terms of how it might be used to mark up a web page is like only looking at a computer as a fancy way to store your recipes. Well that analogy may be stretching things - but you get the gist.

    XML is completely platform and application independent. It is self contained because it encapsulates both the data structure (or schema) as well as the data. This is more profound that it at first seams. XML allows for complex data shaping (subsets within sets) more easily (and with less risk to data integrity) than data formated into a tables or CSV (comma seperated values) files.

    Sounds great but what does it mean? Imagine this. You have data sitting in a spreadsheet or a database. You can export that data as XML and it is now available to be used by any application on any platform anywhere. You can grab that data accross a network and suck it into a dynamically created web page and serve it accross the www. It doesn't matter if the spreadsheet is Excel or Lotus or whether its running on a Win32 machine, a macintosh or a sun sparc. Similarly at the other end (the web server where it is being used to create a dynamic web page) it doesn't matter if the web platform is VBScript/ASP/IIS/NT or PHP/Apache/FreeBSD.
    Last edited by freakysid; May 20, 2001 at 11:38.

  5. #5
    grasshoppa Snowbird122's Avatar
    Join Date
    Apr 2001
    Location
    Austin
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another thing is that storing data in XML rather than in a databse lets you represent your data the way you want to, rather than making you fit it into a table structure.

    For example lets say you run a store and you sell products. If you want to store information about these products in a database, you will need to make a field for each attribute of each product. You might sell tires, which will have a diameter field, and you might sell motor which will have a volume attribute. You will need a diameter field and a volume field in your database.

    Of course the motor oil doesn't have a diameter, and the tires dont have volume, even though these are both products. Of course you could have 2 separate tables, but what if you have 20,000 product types? Are you going to have 20,000 tables?

    <?xml version="1.0"?>
    <Products>
    &nbsp;&nbsp;&nbsp;<Product>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<Tire>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<Diameter>16 inches</Diameter>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</Tire>
    &nbsp;&nbsp;&nbsp;</Product>
    &nbsp;&nbsp;&nbsp;<Product>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<MoterOil>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<Volume>18 ounces</Volume>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</MotorOil>
    &nbsp;&nbsp;&nbsp;</Product>
    </Products>

    XML allows you to describe your data the way you want to. It is not the answer to everything, but it opens up a lot of possibilities.


Bookmarks

Posting Permissions

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