filter.xslt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns="http://schemas.microsoft.com/wix/2006/wi"
  5. xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
  6. <!-- <xsl:key name="unusedcomponent-search" match="wix:Component[not (contains(wix:File/@Source, '.dll')) or contains(wix:File/@Source, 'mod')]" use="@Id"/> -->
  7. <xsl:key name="unusedcomponent-search" match="wix:Component[not (contains(wix:File/@Source, '.dll'))]" use="@Id"/>
  8. <xsl:key name="unusedcomponent-openh264" match="wix:Component[contains(wix:File/@Source, 'openh264.dll')]" use="@Id"/>
  9. <!-- strip all extraneous whitespace -->
  10. <xsl:strip-space elements="*"/>
  11. <!-- Copy all attributes and elements to the output. -->
  12. <xsl:template match="@*|*">
  13. <xsl:copy>
  14. <xsl:apply-templates select="@*" />
  15. <xsl:apply-templates select="*" />
  16. </xsl:copy>
  17. </xsl:template>
  18. <!-- Exclude all File elements that are not a .dll file -->
  19. <xsl:template match="wix:Component[not(contains(wix:File/@Source, '.dll'))]" />
  20. <!-- Exclude openh264.dll (See https://www.openh264.org/BINARY_LICENSE.txt) -->
  21. <xsl:template match="wix:Component[contains(wix:File/@Source, 'openh264.dll')]" />
  22. <!-- Exclude Directory elements -->
  23. <!--<xsl:template match="wix:Directory[not(contains(*/@Source, '.pdb'))]"/>-->
  24. <xsl:template match="wix:Directory[@Name='htdocs']"/>
  25. <xsl:template match="wix:Directory[@Name='images']"/>
  26. <xsl:template match="wix:Directory[@Name='fonts']"/>
  27. <xsl:template match="wix:Directory[@Name='conf']"/>
  28. <xsl:template match="wix:Directory[@Name='sounds']"/>
  29. <xsl:template match="wix:Directory[@Name='grammar']"/>
  30. <!-- Remove ComponentRefs. -->
  31. <xsl:template match="wix:ComponentRef[key('unusedcomponent-search', @Id)]"/>
  32. <xsl:template match="wix:ComponentRef[key('unusedcomponent-openh264', @Id)]"/>
  33. </xsl:stylesheet>