How The Thdl Toolbox Works

THDL Toolbox > Developers' Zone > Web-Development > THDL Toolbox Markup > How the THDL Toolbox Works

Contributor(s): Than Grove

How the THDL Toolbox Works

The THDL Toolbox page is created from an XSLT transformation of an XML document that is pumped through a PHP script to keep the URL clean. This means that when you go to the …/toolbox/index.php, that script makes the XML transformation call and pumps the output into your browser. So, the basic data file that provides the tree structure for the Toolbox is the external link: toolbox.xml file in the same folder.

The toolbox.xml file is a series of nested <div>s, each with an ID, LABEL, and TYPE attribute. The ID attribute is a unique value of "thdl" plus the date in milliseconds. The LABEL is what appears in the tree hierarchy, and the TYPE is an explicit designation of where it is in the hierarchy: "level1", "level2", or "level3". Subdivisions of a particular division are also <div>s nested within its <div> tags as its children. Each <div> contains a <divinc> with an HREF, TYPE, and optional BEHAVIOR attributes. The <divinc>s HREF attribute set to the address of the Collab wiki page it refers to without the constant base for that URL, which is "https://collab.itc.virginia.edu/access". For instance, the HREF might be "/wiki/site/c06fa8cf-c49c-4ebc-007f-482de5382105/qtvrs.html". The TYPE attribute is always set to "wiki". The BEHAVIOR attribute on the <divinc> is used in the case of pages that are not open to the public but are restricted. These cases have their BEHAVIOR attribute set to "restricted", which requires the user to logon to Collab before viewing the page.

The XSLT stylesheet is external link: www.thdl.org/xml/styles/toolbox.xsl. It is applied to the XML document by the Saxon servlet and thereby transforms the XML into XHTML. It creates a series of XHTML <div> that are styled to indent in a cascading tree form. To the right of the tree there is an IFrame with the content of the desired page. When the site is first visited, there is a generic welcome message in the IFrame but once a section is clicked, its content appears in the right hand frame.

Other pages involved in the toolbox site are: