About Xml Transformation

THDL Toolbox > Developers' Zone > Web-development > Backup for XML Transformation

Backup for XML Transformation

Contributor(s): Nathaniel Grove

XML transformations are presently done through the Saxon Servlet that is running on an instance of Tomcat at Orion's port :8080. Should this go down a back-up plan has been established, since XML transformations are integral to so many parts of THDL. The plan is to switch the transformations from Orion's :8080 port to the library's standard transformation servlet at external link: http://text.lib.virginia.edu. In general, this can be done by switching the call in the URL from:

external link: http://orion.lib.virginia.edu:8080/servlet/SaxonServlet

to …

external link: http://text.lib.virginia.edu/servlet/SaxonServlet

… while keeping all the paramenters "?source= …" and "&style= …" the same. If the URL call that creates the web page from XML contains " external link: http://orion.lib.virginia.edu:8080/servlet/SaxonServlet", then this must be changed in the link.

However, in THDL there are several PHP scripts that are used to make the transformation calls and then pipe the results into a THDL page. For most transformations (the main exception for now being the Sera sight), these PHP scripts are what will need to be changed. Most will know the two main ones -- show.php and showEssay.php, but there are also one's for the Journal and EWTS. So the "full" list is:

These scripts have been designed so that at the top you will see something like the following code:

$base = $server . $port . $saxon; // For when Orion's tomcat goes down, uncomment the line below. When it's up, comment out the line below by 2 slashes as this line. $base = "http://text.lib.virginia.edu/servlet/SaxonServlet";

When Tomcat and Saxon on Orion are running properly, we want that last line commented out so that it looks like this:

// $base = "http://text.lib.virginia.edu/servlet/SaxonServlet";

But when Orion's tomcat crashes for extended periods (or as in this case over the weekend), you can uncomment that line by removing the slashes. This overwrites the first value for $base which is the orion location with the Hatbox transformation servlet. When Orion's version of tomcat gets rebooted and the saxon servlet is up and running, that last line can once again be commented out so that the scripts use Orion's servlet.

Remember: The Orion version of the servlet provides faster transformations, because the call is going to the same machine as the style and source. So, whenever possible, it's transformation servlet should be used.

Provided for unrestricted use by the external link: Tibetan and Himalayan Digital Library