Introduction to XSL

IBM Watson Explorer Watson Explorer uses XSL and XPath extensively to offer programmatic customizations that can be added directly from the Watson Explorer Engine administration tool without having to modify or recompile the software or use Watson Explorer at the API level.

See the World Wide Web Consortium for a complete specification of XSL Transformations (XSLT) and XPath. Many online resources are available. For a quick reference, download the very convenient XSLT and XPath Quick Reference Card that was created by Mulberry Technologies.

To make writing XSL easier, when Watson Explorer processes XSL code which does not start with the standard XML preamble (<?xml version="1.0" encoding="UTF-8"/>, it will automatically surround the code with the following:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet  version="1.0"
	xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
	xmlns:math='http://exslt.org/math'
	xmlns:str='http://exslt.org/strings'
	xmlns:dyn='http://exslt.org/dynamic'
	xmlns:exsl='http://exslt.org/common'
	xmlns:set='http://exslt.org/sets'
	xmlns:date='http://exslt.org/dates-and-times'
	xmlns:func='http://exslt.org/functions'
	xmlns:lib='http://xmlsoft.org/XSLT/namespace'
	xmlns:viv='http://vivisimo.com/exslt'
	xmlns:file='http://vivisimo.com/file'
	xmlns:disp='http://vivisimo.com/disp'
	xmlns:vse='http://vivisimo.com/vse'
	xmlns:axl='http://vivisimo.com/axl'
	extension-element-prefixes='math str dyn exsl set date func lib viv file vse axl disp'
>

	YOUR CODE HERE
</xsl:stylesheet>

This will conveniently enable all of the supported XSLT extensions.

The next two sections describe two sets of XSL extensions available in Watson Explorer:

  1. the standard EXSLT extensions that are supported by Watson Explorer
  2. Watson Explorer XML extensions that are only available in Watson Explorer or Watson Explorer applications