You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jb...@apache.org on 2010/06/12 21:36:26 UTC
svn commit: r954070 -
/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl
Author: jbeard
Date: Sat Jun 12 19:36:25 2010
New Revision: 954070
URL: http://svn.apache.org/viewvc?rev=954070&view=rev
Log:
Created a small test that shows how xsl can be used to create a list of unique events.
Added:
commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl (with props)
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl?rev=954070&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl Sat Jun 12 19:36:25 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:s="http://www.w3.org/2005/07/scxml"
+ version="1.0">
+
+ <xsl:output method="text"/>
+
+ <!--prepare to examine all names valued by surname-->
+ <xsl:key name="events" match="s:transition" use="@event"/>
+
+ <xsl:template match="/"> <!--root rule-->
+ <!--select only those name elements whose unique
+ generated id is equal to the generated id of the
+ first of the key members with the same surname-->
+
+ <xsl:for-each
+ select="//s:transition[generate-id(.)=
+ generate-id(key('events',@event)[1])]">
+
+ <xsl:value-of select="@event"/> <!--show the grouping-->
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl
------------------------------------------------------------------------------
svn:eol-style = native