Created
November 16, 2012 02:23
-
-
Save kognate/4083374 to your computer and use it in GitHub Desktop.
xslt for generating list of segues
This file contains 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
#!/bin/bash | |
# run this file by chmod 755 generate.sh | |
# and then (in the same path as the xslt files) | |
# ./generate.sh someoutputfile PATHTOSTORYBOARD | |
# | |
xsltproc segue-h.xslt $2 > ${1}.h | |
xsltproc segue-m.xslt $2 > ${1}.m |
This file contains 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output type="text" omit-xml-declaration="yes"/> | |
<xsl:template match="/"> | |
<xsl:apply-templates select="document"/> | |
</xsl:template> | |
<xsl:template match="document"> | |
<xsl:apply-templates select="//segue/@identifier"/> | |
</xsl:template> | |
<xsl:template match="//segue/@identifier"> | |
<xsl:text>extern NSString *const SEGUE_</xsl:text><xsl:value-of select="."/><xsl:text>; | |
</xsl:text> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains 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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output type="text" omit-xml-declaration="yes"/> | |
<xsl:template match="/"> | |
<xsl:apply-templates select="document"/> | |
</xsl:template> | |
<xsl:template match="document"> | |
<xsl:apply-templates select="//segue/@identifier"/> | |
</xsl:template> | |
<xsl:template match="//segue/@identifier"> | |
<xsl:text>NSString *const SEGUE_</xsl:text><xsl:value-of | |
select="."/><xsl:text> = @"</xsl:text><xsl:value-of select="."/><xsl:text>"; | |
</xsl:text> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment