XSL has a steep learning curve starting out. I suggest using a separate
command-line transform tool to test the XSL to make sure it works how you
expect BEFORE trying to apply it as part of the heat process. You can get
msxsl.exe from here:
http://www.microsoft.com/downloads/details.aspx?familyid=2FB55371-C94E-4373-B0E9-DB4816552E41&displaylang=en
Here's a working XSL from WiX's examples\test\msbuild.heatproj, which might
help you get started. This example preserves most of heat's generated code, but
deletes a specific component by ID.
<?xml version="1.0" ?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<!-- By default, copy all attributes and elements to the output. -->
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="*" />
</xsl:copy>
</xsl:template>
<!-- Override copy (do nothing) for elements with this Id, so they are
omitted from the output. -->
<xsl:template match="*...@id='TestProject.Sources.app.config']" />
</xsl:transform>
While I wrote the code above, I'm far from an expert on XSL so I can't promise
that it's the simplest/best possible way to do that. And I probably won't be
able to help with coding a much more complex transform.
-Jason-
-----Original Message-----
From: PoKrec [mailto:[email protected]]
Sent: Wednesday, March 25, 2009 5:40 AM
To: [email protected]
Subject: [WiX-users] Heat & xsl
hi
I use heat to generate wxs:
"heat file x.txt -t:tr.xsl -out x.wxs"
and as a result i get error:
"heat.exe : error HEAT5055 : Error applying transform C:\work\sandbox\tr.xsl to
harvested WiX: Token StartElement in state EndRootElement would result in an
invalid XML document. Make sure that the ConformanceLevel setting is set to
ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML
fragment."
tr.xsl:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" indent="no"/>
<xsl:template match="/wix:Wix">
<xsl:copy-of select="./*"/>
</xsl:template>
</xsl:stylesheet>
I am just starting learning xsl so i will appreciate any help with this
br
PoKrec
--
View this message in context:
http://n2.nabble.com/Heat---xsl-tp2532164p2532164.html
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users