XML - Purpose?

What exactly is the purpose of XML? It is really easy to learn, but I have no idea how or why to implement it into my site.

I was at a loose myself until I discovered Sablotron… Now it makes for an easy template mechanism… :smiley:

That page helped a little, but im still unclear as to how someone uses it, could someone just show me a simple example of how they used it?

I thing XML is useful… but people talks about it like if it was the great salvation…

XML is useful if you want to send structured data to other people without giving them your database info or any other method…

it is just a way to format data for delivery…

Anyway, you need a parser to understand the data…

I dont know… to me it is a wasting of time… but I know people that use this a lot and its very helpful.

Its just a tool.



This page reads the XML files from MapRaider.com, and structures the data to suit the layout of the site. There is also a “map-of-the-day” feature on the home-page, which is also generated from XML.

In it’s rawest sense, XML is just a way of structuring data for platform independent exchange. If you’ve ever worked with CSV (comma seperated data) and wished you handn’t, XML is really about solving that problem. If I can cheesily point you at my Sitepoint article introducing XML perhaps that will make it clearer.

Okay, I think i got the gist of it. Not sure I like it though, doesn’t seem to special to me.

Amazon’s affiliate program uses XML to share its catalog-content, so that web-masters can customize it to suit their site.

You don’t think that’s special? :confused:

Unrelated to its database leanings, if the W3C had their way every site on the net would be powered by XML and XSL.

It isn’t too special. :wink:

XML is just a very good way to format data before you transfer it somewhere.

Trillian instant messenger uses XML to store your buddy list. XML has many uses. :slight_smile:

Really? Trillian is pretty awesome, use it all the time.

Looking at my Trillian directory, it contains 2 XML files: C:\Program Files\Trillian\users\default\Buddies.xml and C:\Program Files\Trillian\users\default\Events.xml.

ASP.NET (and IIS) uses it for configuration files, and the future version of MS Word files are going to have it as a file format, I think.

It’s not even a very good way. :slight_smile: It’s just ‘a way’ (which is actually pretty poor, what with all the tag-overhead, and the forced hierarchical structure), one which the industry has adopted as a standard.

I’ll agree with the overhead (but hey, CPU’s cheap ;)) but I’m not sure what you mean by “forced hierarchical structure”? Why not just use a series of un-nested tags if you want “flat” data?

As far as I can see, that’s one of the main advantages of XML - it allows you to represent hierarchical data in a very simple manner if you need to. But I’m not sure it forces you to…

Overhead in both CPU and bandwidth, too.

Since XML is based upon a hierarchical model, so it requires a hierarchy. You still have to have a root, etc. – it’s just a very wide, unbalanced tree. :slight_smile:

But on the other hand, why would you even use XML if you were going to format a document in the manner you suggest?

I’ve readed lots of documentation from Microsoft about Visual Studio .NET and the .NET framework and that uses XML in almost everting. It’s also one of the best ways of building web services ( due to communication between win 32 applications-web applications, servers and not microsoft applications cuss it’s a standard that everyone supports and understand). XML also it’s the only way to build dinamic flash applications (link to databases, and information store). In fact i came to this forum looking for some nice tutorials of flash-XML cuss i think that it’s a great tool… if u know of some, plz tell me. :smiley:

Yes, XML is a way to structure data into documents. XML must be hierarchichal, otherwise the data wouln’t be structured.

The data in XML documents can be validated for syntactic correctness (no missing tag endings) and validated for semantic correctness (all the data you need is actually there). There is no way to do this with any other data storage mechanism which has also been standardized the way XML has.

When you have an XML document containing data (such as forum postings), you can transform the document, using XSL, into any output format, for example PDF files, HTML, WAP files, CSV, and even into another XML document. Because of this, you can use XML and XSL to cleanly separate your content from your presentation. This is what many template applications try to do.

Using XPath you have a very powerful mechanism for filtering, sorting and finding matching data in your XML documents. This comes in handy, because you are no longer forced to use the data the way it is fed to you, you can sort it yourself easily.

Another big advantage of the whole XML thing is the ability to serialize objects using it. What this means is, you can have an application in America using complicated logic to create book data, which is then sent over the net to you somewhere in Asia, and you can recreate the same objects using the same data immediately. This is called data marshalling, and it becomes really useful in some unlikely ways.

XML has advantages, and disadvantages. Whether or not you use it now depends on your commitment to learning XML, DTDs, XSL, XPath and the different parsers available. At some point learning the XML technologies is probably unavoidable.

  • Richard