commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r954070 - /commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/triggers.xsl
Date Sat, 12 Jun 2010 19:36:26 GMT
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>&#10;</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



Mime
View raw message