Handling XML in Tcl
Note
This section assumes that the reader is familiar with terms like XML, DOM, SAX, XPath and others related.
Just as with almost every modern programming language, Tcl offers comprehensive set of tools designed to facilitate the use of the XML standard. Basically Tcl is born to work with XML, thanks to native support for Unicode encoding. There are a lot of extensions for handling XML documents, but without a doubt one of the most important is tDOM
(http://www.tdom.org). The power of this extension comes from the fact it is implemented in C language, therefore it is fast and efficient, with reasonable memory consumption; the extension supports XPath, XSLT and optional DTD validation. From a practical point of view it is also easy to get, as it is included in the ActiveTcl distribution.
The name of this extension clearly indicates that it works as an XML Document Object Model (DOM) parser. In other words, the document is treated as a tree-like structure. While we will...