You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/11/24 07:17:25 UTC
svn commit: r883599 - /incubator/pivot/trunk/demos/xsl/index.xsl
Author: tvolkert
Date: Tue Nov 24 06:17:20 2009
New Revision: 883599
URL: http://svn.apache.org/viewvc?rev=883599&view=rev
Log:
Updated demo xsl to handle off-site demos
Modified:
incubator/pivot/trunk/demos/xsl/index.xsl
Modified: incubator/pivot/trunk/demos/xsl/index.xsl
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/demos/xsl/index.xsl?rev=883599&r1=883598&r2=883599&view=diff
==============================================================================
--- incubator/pivot/trunk/demos/xsl/index.xsl (original)
+++ incubator/pivot/trunk/demos/xsl/index.xsl Tue Nov 24 06:17:20 2009
@@ -94,12 +94,29 @@
<hr/>
</xsl:if>
- <xsl:variable name="id" select="@id"/>
- <xsl:variable name="demo" select="document(concat('../www/', $id, '.xml'))/document"/>
+ <xsl:choose>
+ <xsl:when test="@href">
+ <!--
+ Demo items with an href are assumed to be hosted remote. Remote hosted demos
+ do not have a JNLP launcher, and their title and description is assumed to be
+ nested in the demo item itself.
+ -->
+ <xsl:variable name="href" select="@href"/>
+ <h3><a href="{$href}"><xsl:value-of select="title"/></a></h3>
+ <p><xsl:value-of select="description"/></p>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--
+ Locally hosted demo. We pull the demo metadata from the demo XML file.
+ -->
+ <xsl:variable name="id" select="@id"/>
+ <xsl:variable name="demo" select="document(concat('../www/', $id, '.xml'))/document"/>
+ <h3><a href="{$id}.html"><xsl:value-of select="$demo/properties/title"/></a></h3>
+ <p><a href="{$id}.jnlp">Web start</a></p>
+ <p><xsl:value-of select="$demo/properties/description"/></p>
+ </xsl:otherwise>
+ </xsl:choose>
- <h3><a href="{$id}.html"><xsl:value-of select="$demo/properties/title"/></a></h3>
- <p><a href="{$id}.jnlp">Web start</a></p>
- <p><xsl:value-of select="$demo/properties/description"/></p>
<xsl:if test="screenshot">
<xsl:variable name="src" select="screenshot"/>
<p><img src="{$src}"/></p>