What XML Is Not

(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)

XML is a markup language, and it is only a markup language. Keep that in mind. The hype surrounding XML has become so extreme that many people seem to believe it can even make coffee or wash the family dog.

First of all, XML is not a programming language. There is no XML compiler that reads XML files and produces executable code. You could perhaps define a scripting language that uses a native XML format and is interpreted by a program, but even that would be an unusual application. XML can be used as a format for instructions to programs that cause certain things to happen, just as a traditional program can read a configuration file and perform different actions depending on what it finds there. Indeed, there is no reason why a configuration file should not be written in XML rather than unstructured text. Some newer programs already use XML configuration files. In every case, however, it is the program that takes action, rather than the XML document itself. An XML document simply exists. It does nothing.

Note: At least one XML application has been shown to be Turing-complete: XSL Transformations (XSLT). Unidex provides a universal Turing machine written in XSLT.

Secondly, XML is not a network transport protocol. XML does not send data over a network, any more than HTML does. Rather, the data sent over a network using HTTP, FTP, NFS or another protocol may be encoded in an XML format. Once again, however, software outside the XML document must actually transmit it.

Finally, to mention the example in which the hype leaves reality furthest behind: XML is not a database. You will not replace an Oracle or MySQL server with XML. A database can contain XML data as VARCHAR, BLOB or a dedicated XML data type, but the database itself is not an XML document. You can store XML data in a database or on a server, or retrieve data from a database in XML format. To do so, however, you need software written in a real programming language such as C or Java. To store XML in a database, software on the client sends the XML data to the server using a common network protocol such as TCP/IP. The server-side software receives the XML data, passes it through a parser and stores it in the database. To retrieve an XML document from a database, you generally use a product such as Enhydra, which sends SQL queries to a database and formats the result set as XML before returning it to the client. Some databases may integrate this software into their servers or offer plug-ins to perform this task, such as the Oracle XSQL servlet. XML is very well suited to serving as a ubiquitous, platform-independent interchange format in these scenarios. However, XML is not the database and should not be regarded as one.

   

<< backnext >>