How is XML better than prior languages such as DHTML?

Thijs Stalenhoef

(From Mathew Cobby) XML is purely "data about data". i.e. there is no concept of HOW something should look, it might not even have a visual representation. XML is about shoving data around and then doing something application specific with it. DHTML is about creating pages and how they should look (and behave). In XML there is no concept of a page, just nodes of data. XML is really a backend tool while DHTML is more of a front end tool.

(From Thijs Stalenhoef) It is tempting to compare HTML to XML, but they are in fact two quite different beasts which both share the same ancestor, namely SGML (Standard Generalized Markup Language). HTML gives data a certain look. XML on the other hand gives data meaning. XML documents say nothing about how the data they include should be represented. That is up to other systems such as XSL that can convert XML documents to (amongst other things) HTML.

Simple example: say you are building a website that will contain a lot of books. in HTML you could do something like:
XML What's it all about

Author: N.B. Inparticular

Price: $25.45

Available: Yes

This will give you 4 lines of text about the book. In XML you would do something similar:

<Book Available="yes">
<Title>XML What's it all about</Title>
<Author>N.B. Inparticular</Author>

The same essential information is present, only in XML is because really easy for an automated system to detect the structure of the document and for instance store it in a database or convert it to HTML, PDF or something else. Check out the XML tutorials on www.webmonkey.com for a slightly more in depth discussion of XML and what it means. The book "The XML Handbook" published by Prentice Hall is very good material also.