Created
November 12, 2012 17:08
-
-
Save jbeard4/4060570 to your computer and use it in GitHub Desktop.
Normalize Initial States
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:s="http://www.w3.org/2005/07/scxml" | |
xmlns="http://www.w3.org/2005/07/scxml" | |
version="1.0"> | |
<xsl:output method="xml"/> | |
<!-- identity transform --> | |
<xsl:template match="@*|node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()"/> | |
</xsl:copy> | |
</xsl:template> | |
<xsl:template match="s:*[@initial]"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*"/> | |
<initial id="{concat(@id,'_initial')}"> | |
<transition target="{@initial}"/> | |
</initial> | |
<xsl:apply-templates select="node()"/> | |
</xsl:copy> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment