Jeffrey Moore CSCI E-259 final project proposal April 13, 2006 Title: Declarative DHTML Author: Jeffrey Moore Abstract: Declarative DHTML extends XHTML with elements for common browser-side actions. This relieves the author from writing error-prone procedural JavaScript code, while keeping the XHTML elements close to their behaviors in the source. Details: Declarative DHTML extensions to XHTML include: - or . This turns the contents of a table header cell into a hyperlink, which will sort the body rows of the containing table. The sort will be by the value of the text in the same column of the table as the cell. Clicking the sort link a second time will reverse the order of the sort. - XHTML content for popup anchor

First popup item

Second popup item

This creates a popup menu, with the given anchor content. Clicking on the anchor pops up the remaining content of the popupmenu, including links. - This creates a text box whose value can be used to document what to type into the box. As soon as the user clicks the box, the predefined text disappears. A simple shell script on nice will invoke Xalan, using a custom XSLT stylesheet to convert these extended features into regular XHTML elements with JavaScript code to implement the dynamic behaviors. This code will coexist, as far as I can manage, with any hand-coded JavaScript in the document. The resulting D(X)HTML documents will run properly in Firefox; cross-browser operation is outside the scope of this project. Motivation: Common client-side behaviors in XHTML require more JavaScript code than they're worth. Generating this code cuts down on the potential for coding errors. Also, a declarative style, keeping the description of an HTML object's beheviors close to the object, aids maintainers in understanding what a page is doing. Method: In this project, I will use XSLT to generate JavaScript code. This code will use the XHTML DOM, as supported in Firefox, to manipulate the page. I'll need to gain some experience in generating JavaScript code in such a way that it doesn't interfere with other JavaScript on the same page. Questions: Can I extend the XHTML Transitional or Strict DTD to validate Declarative DHTML? Is there a way to use Tomcat to apply the XSLT to Declarative DHTML sources on the fly, rather than pre-converting all the pages on the website? Are there other common Web behaviors I should tackle? Punch-the-monkey-and-win? Some simple case of AJAX?