Skip to content

Instantly share code, notes, and snippets.

@fshp
Created April 15, 2015 14:29
Show Gist options
  • Save fshp/cd62317683fe449ecade to your computer and use it in GitHub Desktop.
Save fshp/cd62317683fe449ecade to your computer and use it in GitHub Desktop.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/animationsprite">
<animationsprite>
<xsl:for-each select="//frame">
<sprite>
<xsl:attribute name="start">
<xsl:text>0</xsl:text>
</xsl:attribute>
<xsl:for-each select="framepart">
<texture>
<xsl:attribute name="path">
<xsl:value-of select="texture"/>
</xsl:attribute>
<offset>
<xsl:value-of select="frameparam/position/offx"/>
<xsl:text> </xsl:text>
<xsl:value-of select="frameparam/position/offy"/>
</offset>
</texture>
</xsl:for-each>
</sprite>
</xsl:for-each>
</animationsprite>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment