Writing XML with Tcl

Project Home
Open this chapter TclXML
Open this chapter TclDOM
Open this chapter TclXSLT
Open this chapter Combo Distribution
Open this chapter tkxmllint
Open this chapter tkxsltproc
Open this chapter TclTidy
 Xmlgen You are here
  Go to this section Introduction
  Go to this section Download and Installation
  Go to this section Documentation
Open this chapter Success Stories

The Tcl package xmlgen allows to write Tcl code which translates itself into XML.


Every tag is made into a markup command which takes attributes and the element's content as parameters and then prints the XML tagged content. Of course, the content again can contain markup commands.

On top of xmlgen there is the package htmlgen which comes with all the typical HTML tags predefined as markup commands. In addition, htmlgen::extra contains what you could call markup macros. A markup macro's syntax resembles the syntax of a markup command but creates not just a pair of tags with content but a whole structure of tags nested always in the same way. Currently htmlgen::extra::tab and htmlgen::extra::sidenav implement common navigation structures for HTML sites.

Download and Installation

You find the package on the TclXML page at SourceForge. Installation instructions are included, but since no compilation is required, installation is not much more than copying files to certain places.


The manual pages are available online.