1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<?xml version="1.0" encoding="utf-8" ?>
- <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xp="http://www.giuntilabs.com/exact/xp_v1d0" version="1.0">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="yes" />
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="//text">
- <p>
<xsl:value-of select="//text" />
</p>
</xsl:when>
- <xsl:when test="//image">
- <!--
<script>
<xsl:attribute name="language">
<xsl:value-of select='javascript'/>
</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select='./resizeIMG.js'/>
</xsl:attribute>
</script>
-->
- <body>
- <xsl:attribute name="onload">
<xsl:value-of select="redimImage(" />
<xsl:value-of select="//image/xp:img/@href" />
<xsl:value-of select=", 400, 300)" />
</xsl:attribute>
</body>
</xsl:when>
- <xsl:when test="//flash">
- <object type="application/x-shockwave-flash">
- <xsl:variable name="file">
- <xsl:call-template name="substring-after-last">
<xsl:with-param name="string" select="//flash/@src" />
</xsl:call-template>
</xsl:variable>
- <xsl:attribute name="data">
<xsl:value-of select="//flash/@src" />
</xsl:attribute>
- <xsl:attribute name="id">
<xsl:value-of select="substring-before($file, '.')" />
</xsl:attribute>
<param name="allowScriptAccess" value="sameDomain" />
- <param name="movie">
- <xsl:attribute name="value">
<xsl:value-of select="//flash/@src" />
</xsl:attribute>
</param>
<param name="quality" value="high" />
</object>
</xsl:when>
<xsl:otherwise />
</xsl:choose>
</xsl:template>
- <xsl:template name="substring-after-last">
<xsl:param name="string" />
<xsl:param name="delimiter" select="'/'" />
- <xsl:choose>
- <xsl:when test="contains($string, $delimiter)">
- <xsl:call-template name="substring-after-last">
<xsl:with-param name="string" select="substring-after($string, $delimiter)" />
<xsl:with-param name="delimiter" select="$delimiter" />
</xsl:call-template>
</xsl:when>
- <xsl:otherwise>
<xsl:value-of select="$string" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet> |