208
|
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
2
|
|
3 <xsl:output method="xml" indent="yes" encoding="iso-8859-1"
|
|
4 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
|
5 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
|
|
6
|
|
7 <!-- the start -->
|
|
8 <xsl:template match="relato">
|
|
9 <html xmlns="http://www.w3.org/1999/xhtml">
|
|
10 <head>
|
|
11 <script type="text/javascript">
|
|
12 <xsl:apply-templates select="functions" />
|
|
13 <xsl:apply-templates select="buttons" />
|
|
14 </script>
|
|
15 <script type="text/javascript" src="relato/relato.js"></script>
|
|
16 </head>
|
|
17 <xsl:apply-templates select="frames" />
|
|
18 </html>
|
|
19 </xsl:template>
|
|
20
|
|
21 <xsl:template match="frames">
|
|
22 <xsl:copy-of select="frameset" />
|
|
23 </xsl:template>
|
|
24
|
|
25 <xsl:template match="functions">
|
|
26 <xsl:for-each select="function">
|
|
27 function <xsl:value-of select="@name" />() {
|
|
28 if (frameSelected()) {
|
|
29 <xsl:for-each select="validInFrame">
|
|
30 if (nameOfSelectedFrame() == "<xsl:value-of select="@name" />") {
|
|
31 id = selectedFrameObject();
|
|
32 return id.<xsl:value-of select="../@name" />(<xsl:value-of select="../@name" />.arguments[0], <xsl:value-of select="../@name" />.arguments[1], <xsl:value-of select="../@name" />.arguments[2], <xsl:value-of select="../@name" />.arguments[3]);
|
|
33 }
|
|
34 </xsl:for-each>
|
|
35 } else {
|
|
36 <xsl:choose>
|
|
37 <xsl:when test="not(@quiet = 'true')">
|
|
38 // alert message
|
|
39 noFrameSelected();
|
|
40 </xsl:when>
|
|
41 <xsl:otherwise>
|
|
42 // be quiet
|
|
43 return false;
|
|
44 </xsl:otherwise>
|
|
45 </xsl:choose>
|
|
46 }
|
|
47 }
|
|
48 </xsl:for-each>
|
|
49 </xsl:template>
|
|
50
|
|
51 <xsl:template match="buttons">
|
|
52 function dynamicButtons() {
|
|
53 var btns = '';
|
|
54 <xsl:for-each select="button">
|
|
55 btns += '#<xsl:value-of select="@name" />|<xsl:value-of select="@command" />';</xsl:for-each>
|
|
56 return btns.slice(1);
|
|
57 }
|
|
58 </xsl:template>
|
|
59
|
|
60 </xsl:stylesheet>
|