Guest User

wwise-bank-renamer

a guest
Jun 9th, 2017
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
  3. <!--
  4. Wwise renamer XSL v1 (by bnnm)
  5. Extracts .wem names from SoundBankInfo.xml to generate Windows CMD rename commands.
  6. -->
  7.  
  8. <!-- external vars -->
  9. <xsl:param name="param.name2wem"/>
  10. <xsl:param name="param.wem2wem_name"/>
  11.  
  12.  
  13. <!-- output format -->
  14. <xsl:output method="text" indent="no" encoding="UTF-8"/>
  15.  
  16. <!-- root match -->
  17. <xsl:template match="/">
  18. <!-- UTF8 codepage and stuff for batch -->
  19. <xsl:text>@REM utf8 ignore&#xd;&#xa;&#xd;&#xa;</xsl:text>
  20. <xsl:text>@echo off&#xd;&#xa;</xsl:text>
  21. <xsl:text>chcp 65001&#xd;&#xa;</xsl:text>
  22.  
  23. <xsl:for-each select="SoundBanksInfo/StreamedFiles/File">
  24. <!-- write ren line for each file -->
  25. <xsl:choose>
  26. <xsl:when test="$param.name2wem">
  27. <xsl:text>ren "</xsl:text><xsl:value-of select="ShortName"/><xsl:text>.wem" </xsl:text><xsl:value-of select="@Id"/><xsl:text>.wem&#xd;&#xa;</xsl:text>
  28. </xsl:when>
  29. <xsl:when test="$param.wem2wem_name">
  30. <xsl:text>ren </xsl:text><xsl:value-of select="@Id"/><xsl:text>.wem "</xsl:text><xsl:value-of select="@Id"/><xsl:text>__</xsl:text><xsl:value-of select="ShortName"/><xsl:text>.wem"&#xd;&#xa;</xsl:text>
  31. </xsl:when>
  32. <xsl:otherwise>
  33. <xsl:text>ren </xsl:text><xsl:value-of select="@Id"/><xsl:text>.wem "</xsl:text><xsl:value-of select="ShortName"/><xsl:text>.wem"&#xd;&#xa;</xsl:text>
  34. </xsl:otherwise>
  35. </xsl:choose>
  36. </xsl:for-each>
  37. </xsl:template>
  38.  
  39. </xsl:stylesheet>
Add Comment
Please, Sign In to add comment