This should get you started.

<?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";>
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="wix:Wix">
        <xsl:copy>
            <xsl:processing-instruction
name="include">defines.wxi</xsl:processing-instruction>
            <xsl:apply-templates/>
        </xsl:copy>
    </xsl:template>

    <!-- Identity transform. -->
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()" />
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

-----Original Message-----
From: Gary Gocek [mailto:g...@gocek.org] 
Sent: 08 March 2012 17:41
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Transform output of heat to insert an include statement

I use heat to generate a WXS file with Fragments. I used the -var arg to 
replace the path to the files with a preprocessor variable. I can specify 
the variable's value in the command line to candle with the -d argument. 
But, I have a wxi file that I would like to include.

I can transform the output of heat with an XSLT file, and I am successfully 
removing some unwanted files.

But I have not been able to figure out a transform that inserts <?include 
file.wxi ?> inside the Wix element and before the first fragment.

Does anyone have an XSLT example? The end result should be something like:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
  <?include defines.wxi ?>
    <Fragment>
        <DirectoryRef Id="DirId">
            <Component Id="cmpDFB0B44999D95218F6BC4457C253DAB1" 
Guid="{08038211-6E9B-4C75-9278-9B8FF1812BED}">
                <File Id="filF161DE2A55DA8301F09DDB1F0B9F185E" 
KeyPath="yes" Source="$(var.MyPath)\myFile.exe" />
            </Component>
...

Any suggestions?

Thanks,
Gary
-----------------------------------------------------------------------------
-
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
SDL PLC confidential, all rights reserved.
If you are not the intended recipient of this mail SDL requests and requires 
that you delete it without acting upon or copying any of its contents, and we 
further request that you advise us.
SDL PLC is a public limited company registered in England and Wales.  
Registered number: 02675207.
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, 
UK.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to