[wix-users] Heat transform document function

Helge Kruse Helge.Kruse at gmx.net
Tue Jul 4 09:41:05 PDT 2017


Am 04.07.2017 um 17:58 schrieb Joseph L. Casale:
> I am trying to leverage a document() in a transform however my harvest
> path is passed into the build script invoking harvest. The template resides
> in a source directory so there is no option to use a relative path.
> 
> What options do I have here? As far as I know, we don't have transform
> parameters when using heat, so does heat provide any facility for this?

I had to change the heat output to put it in my build project. I use a
XSLT script to change the output. Heat accepts it by the -t parameter.

heat dir Foo -o Foo.wxs -cg Foo -t Include.xslt

XSLT example (Include.xslt):

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:wix='http://schemas.microsoft.com/wix/2006/wi'
    exclude-result-prefixes='wix'>

  <xsl:output method="xml" />

  <xsl:template match="/wix:Wix">
    <xsl:element name="Include">
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>

  <xsl:template match="*">
    <xsl:element name="{name()}">
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:element>
  </xsl:template>

  <xsl:template match="/">
    <xsl:comment>!!!DO NOT EDIT!!! Generated by HarvestDirectory
target.</xsl:comment>
    <xsl:apply-templates/>
  </xsl:template>

</xsl:stylesheet>

Regards
Helge


More information about the wix-users mailing list