8. Trailer (continued) Streamsource of XSL File XSL File StreamSource of XML File XML File StreamResult of Html File Html File StreamSource of XML File StreamResult of Html File
43. To write a stylesheet that will work with multiple XSLT processors? <xsl:stylesheet version="1.0" xmlns:xsl=“ http://www.w3.org/1999/XSL/Transform ” xmlns:redirect =" org.apache.xalan.xslt.extensions.Redirect " xmlns:saxon =" http://icl.com/saxon " xmlns:xt =" http://www.jclark.com/xt " extension-element-prefixes =" redirect saxon xt " > Cast XSL/XSLT
44. Writing extensions in other languages Cast XSL/XSLT <lxslt:component prefix="javascript-extension“ functions="cos sin toRadians"> <lxslt:script lang="javascript"> function cos(d) { return Math.cos(d); } function sin(d) { return Math.sin(d); } function toRadians(d) { return d * Math.PI / 180; } </lxslt:script> </lxslt:component>
54. Discussion XSLT 2.0 - Grouping <paper> <title> XML and PDF in Publishing Workflows</title> <author> Myers, Charles </author> </paper> <paper> <title> On the Way to XML</title> <author> Parsons, Jonathan </author> <author> Caisley, Phil </author> </paper> <author> <name>Caisley, Phil</name> <paper> On the Way to XML </paper> </author> <author> <name>Myers, Charles</name> <paper> XML and PDF in Publishing Workflows </paper> </author> <author> <name> Parsons, Jonathan</name> <paper> On the Way to XML </paper> </author>
55.
56. <paper> <title> XML and PDF in Publishing Workflows</title> <author> Myers, Charles </author> </paper> <paper> <title> On the Way to XML</title> <author> Parsons, Jonathan </author> <author> Caisley, Phil </author> </paper> <author> <name>Caisley, Phil</name> <paper> On the Way to XML </paper> </author> <author> <name>Myers, Charles</name> <paper> XML and PDF in Publishing Workflows </paper> </author> <author> <name> Parsons, Jonathan</name> <paper> On the Way to XML </paper> </author> <xsl:for-each-group select= "paper" group-by= "author" > <xsl:sort select="current-grouping-key()" /> <author> <name> <xsl:value-of select="current-grouping-key()" /> </name> <xsl:for-each select="current-group()"> <paper> <xsl:value-of select="title" /> </paper> </xsl:for-each> </author> </xsl:for-each-group>