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:34:37 UTC
svn commit: r954055 -
/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl
Author: jbeard
Date: Sat Jun 12 19:34:36 2010
New Revision: 954055
URL: http://svn.apache.org/viewvc?rev=954055&view=rev
Log:
Intermediate commit
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl?rev=954055&r1=954054&r2=954055&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl Sat Jun 12 19:34:36 2010
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:s="http://www.w3.org/2005/07/scxml"
- xmlns:c="https://svn.apache.org/repos/asf/commons/sandbox/gsoc/2010/scxml-js/trunk/"
+ xmlns:c="http://msdl.cs.mcgill.ca/"
version="1.0">
<output method="text"/>
@@ -17,7 +17,7 @@
<!--//*[(self::state or self::parallel or self::final or self::initial or self::scxml or self::history) and not(.//*[(self::state or self::parallel or self::final or self::initial or self::scxml or self::history)])]-->
<!--TODO: hook up namespaces -->
- <variable name="allStates" select="//*[(self::state or self::parallel or self::final or self::initial or self::scxml or self::history)]"/>
+ <variable name="allStates" select="//*[(self::s:state or self::s:parallel or self::s:final or self::s:initial or self::s:scxml or self::s:history)]"/>
<variable name="states" select="//s:state"/>
<variable name="parallels" select="//s:parallel"/>
<variable name="finals" select="//s:final"/>
@@ -26,8 +26,8 @@
<variable name="defaultTransitions" select="//s:transition[not(@event)]"/>
<variable name="nonDefaultTransitions" select="//s:transition[@event]"/>
- <variable name="basicStates" select="$allStates[not(.//*[(self::state or self::parallel or self::final or self::initial or self::scxml or self::history)])]"/>
- <variable name="compositeStates" select="$allStates[.//*[(self::state or self::parallel or self::final or self::initial or self::scxml or self::history)]]"/>
+ <variable name="basicStates" select="$allStates[not(.//*[(self::s:state or self::s:parallel or self::s:final or self::s:initial or self::s:scxml or self::s:history)])]"/>
+ <variable name="compositeStates" select="$allStates[.//*[(self::s:state or self::s:parallel or self::s:final or self::s:initial or self::s:scxml or self::s:history)]]"/>
<variable name="parallelRegions" select="$parallels/s:state"/>
@@ -60,11 +60,9 @@
//states enum for glass-box unit testing
- <for-each select="$basicStates">
- <call-template name="genStatesEnum">
- <with-param name="state" select="."/>
- </call-template>
- </for-each>
+ <call-template name="genStatesEnum">
+ <with-param name="states" select="$basicStates"/>
+ </call-template>
//trigger methods for synchronous interaction
<for-each select="$nonDefaultTransitions">
@@ -141,16 +139,15 @@
this.initial = null;
- <!--FIXME: we add depth attribute to state-->
- this.depth = <value-of select="$state/@c:depth"/>;
+ this.depth = <value-of select="count($state/ancestor::*)"/>;
this.historyState = null;
- <if test="$state/self::history">
+ <if test="$state/self::s:history">
this.parent.historyState = this; //init parent's pointer to history state
</if>
- <if test="$state/self::initial">
+ <if test="$state/self::s:initial">
this.parent.initial = this; //init parent's pointer to initial state
</if>
@@ -164,9 +161,7 @@
</if>
<for-each select="$state/onentry/*">
- <call-template name="genExecutableContent">
- <with-param name="executableNode" select="."/>
- </call-template>
+ <apply-templates select="s:if | s:raise | s:log | s:script | s:send | s:cancel | s:invoke | s:finalize | s:datamodel | s:data | s:assign | s:validate | s:param"/>
</for-each>
}
@@ -235,9 +230,10 @@
</s:else>
</s:if>
-->
+
<template match="s:if">
if (<value-of select="@cond"/>) {
- <apply-templates select="c:executableContent/*"> <!--TODO:some filtering here?-->
+ <apply-templates select="c:executableContent/*"/>
}
<apply-templates select="s:elseif"/>
<apply-templates select="s:else"/>
@@ -245,13 +241,13 @@
<template match="s:elseif">
else if (<value-of select="@cond"/>) {
- <apply-templates select="c:executableContent/*"> <!--TODO:some filtering here?-->
+ <apply-templates select="c:executableContent/*"/>
}
</template>
<template match="s:else">
else {
- <apply-templates select="c:executableContent/*"> <!--TODO:some filtering here?-->
+ <apply-templates select="c:executableContent/*"/>
}
</template>
@@ -309,13 +305,6 @@
<!--TODO-->
</template>
- <template name="genStateHooks">
- <param name="s"/>
-
- //gen state hooks here
- </template>
-
-
<template name="genNoIndexOfArrayPrototypeExtension">
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
@@ -388,7 +377,7 @@
do{
//take any available default transitions
- microstep(<value-of name="defaultEventLiteral"/>});
+ microstep(<value-of select="$defaultEventLiteral"/>});
if(!hasTakenDefaultTransition){