The design approach behind Saxon-CE is twofold:
As far as rendering XML is concerned, you can start with the traditional approach of writing a transformation that takes an XML document as input, and produces an HTML page as output. In this case, the
xml-stylesheet processing instruction is used to invoke a small 'boot' stylesheet that loads the Saxon-CE processor before loading the main stylesheet.
For newer projects, where it's possible to make changes that exploit Saxon-CE's capabilities more fully, several additional strategies are available: Since there is an HTML page, it makes sense to use it to create the page framework - the structure of sections and images that will then be populated by content. The stylesheet can then use the XSLT 2.0
xsl:result-document instruction to create as many pieces of content as it wishes, posting each one to a separate container in the HTML page framework.
At this stage you would traditionally include attributes such as
onclick in the generated HTML, each
attribute), and the set of events that it applies to (in its
attribute: a set of standard mode-names such as
ixsl:onclick is provided for this purpose.)
These event-handling template rules can create or modify chunks of content in the HTML page. The new content can be defined in the same way as the original content, using the XSLT 2.0
xsl:result-document instruction. The stylesheet can also modify individual attributes of HTML elements (for example, changing the visibility to "hidden") using the extension instruction
ixsl:set-attribute. This is done without damaging the integrity of XSLT as a declarative language, because the updates are all deferred until each event has been fully processed: the stylesheet sees an immutable input structure, and generates an output which is a set of changes to be applied later.
It is also possible to fire off templates for execution at a later time, thus allowing animations to be constructed.