Scripting XML with TCL
By Steve Ball
One thing I really like about Tcl is that it plays nicely with other languages. Tcl was designed from the beginning to be embedded within a program written in another language, such as C, C++, or Java. In addition, Tcl itself can be extended with components written in those lower-level system-programming languages. It's this adaptability and easy integration that has earned Tcl the nickname "the glue language of the Internet."
When it comes to storing data or shipping it around the network between applications, what's needed is a data format that is independent of any particular language or platform -- one that can be used to represent any arbitrary data structures that a program uses. XML, the eXtensible Markup Language, looks like it will fill this role quite well. If two applications need to exchange information, they can use XML as an intermediate data format. As long as the applications both have support for the XML document type being exchanged, they can communicate. Recently I wrote a couple of support modules that take advantage of this concept: a Web-based workflow system using a SAP R/3 Financial Management System installation and a Tcl interface to the XML-RPC. XML-RPC combines XML with HTTP to provide a simple protocol for performing remote procedure calls. We'll study these two examples in close detail in this article.
XML takes care of the nitty-gritty of endianess (big-endian number representation as opposed to little-endian), internationalization, and so on. Because XML is able to fill this role it has lately been referred to as "data glue," meaning that it can glue together applications.