Book List

To try out the book list application, visit here.

Wait for the list of books to appear (it may take a while if you are on a slow connection, as Saxon is being downloaded into your browser cache from the server). When it appears, try clicking on column headings to sort the tables by a chosen column, or clicking the check boxes to filter which books are displayed.

To see how it works, view the source of the HTML page ("view source" in your browser), and examine the stylesheet.

Note how the HTML page contains two script elements, one to identify the Saxon Javascript library, the other to identify the stylesheet and source document.

Note how the XSLT code addresses an area of the HTML page to be updated using xsl:result-document.

Note the event handlers in the stylesheet - the template rules with mode="ixsl:onclick" or mode="ixsl:onmouseover". Note how these template rules update attributes of the HTML page using ixsl:set-attribute. Also see how user-defined attributes such as data-order and data-type are used to retain state information in the HTML tree, so that the sorting process can decide whether to sort ascending or descending, and whether to sort alphabetically or numerically.

Note how the onmouseover event handler reads the mouse coordinates by a call on the ixsl:event() extension function which returns the current mouse event, and then uses these coordinates to position the tooltip.