This area is an archive and is no longer actively maintained. Information found on this page is likely to be extremely out of date and therefore highly inaccurate.

CVShome.org

W3C Document Object Model (DOM)


Discussion:

This page is concerned with some experimental patches to get CVS to generate XML/HTML which can then be used for scripting CVS using the DOM. This has the potential to allow scripts to have a _much_ cleaner interface to CVS.

Right now it is a proof of concept (that is, it does not give scripts access to all of CVS's features), but extending it probably wouldn't be too hard.

Demo

To see how this works, look at the following demo of the "cvs log" and show/hide various fields, all without contacting the web server. If you want the demo to actually run, you need a browser which supports ECMAscript (javascript) and DOM (see disclaimers below). The cool thing is that even with a totally vanilla browser, you can see the plain text output from "cvs log". The demo page is a static page which was produced on a one-shot basis using the tools below. Of course, running something like this from a live repository is how you would use this approach in practice.

How Does it Work?

First, the data is generated by a modified CVS server which outputs tagged text for cvs log. Tagged text ("MT" response) is a general-purpose feature. There is nothing hackish about the patch which enables tagged text.

Second, a CGI script takes that data and converts the tagged text to XML/HTML. The conversion does not need to know about particular tags - tagged text is very similar to XML/HTML and conversion is easy. For example, MT fname foo.c from the CVS protocol becomes <cvs-fname>foo.c</cvs-fname> in XML/HTML. We add cvs- to the start of the tag name to avoid name clashes with standard HTML tags. Another variant would be <span name="fname">foo.c</span>.

Third, your browser displays the XML/HTML. The code which actually lets the client show and hide fields is written in ECMAscript. The DOM is the interface by which ECMAscript code has a clean way to access particular parts of the XML/HTML document.


Return to The Information Page List.

Derek Price, CVS developer and technical editor of Essential CVS (Essentials line from O'Reilly Press) , and others offer consulting services and training through Ximbiot.