xslt - WiX WSLT transform to remove an attribute from a .wsx file -


another transform noob question: trying come transform remove attribute heated .wxs file.

heat generating class attribute 'relativepath="yes" throwing error in compiler. attribute isn't necessary in our case. , changing "no" not rid of error. run transform remove attribute.

the current output file looks like:

<?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi">     <fragment>         <directoryref id="systemfolder">             <component id="todgub7.dll" guid="{4debd59a-d93a-43cc-ad8a-2198e1c308f7}" permanent="yes">                 <file id="todgub7.dll" keypath="yes" source="$(var.oc2.winsys32)\todgub7.dll">                     <class id="{359aa0c1-ddf8-49db-83ff-6184706a9106}" context="inprocserver32" description="componentoneunbounddatasource" relativepath="yes" threadingmodel="apartment">                         <progid id="componentoneunbounddatasource" description="componentone ole db data source unbound mode" />                     </class>                 </file>                 <registryvalue root="hkcr" key="clsid\{359aa0c1-ddf8-49db-83ff-6184706a9106}\refcount" value="1" type="string" action="write" />             </component>         </directoryref>     </fragment> </wix> 

i hoping get:

<?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi">     <fragment>         <directoryref id="systemfolder">             <component id="todgub7.dll" guid="{4debd59a-d93a-43cc-ad8a-2198e1c308f7}" permanent="yes">                 <file id="todgub7.dll" keypath="yes" source="$(var.oc2.winsys32)\todgub7.dll">                     <class id="{359aa0c1-ddf8-49db-83ff-6184706a9106}" context="inprocserver32" description="componentoneunbounddatasource" threadingmodel="apartment">                         <progid id="componentoneunbounddatasource" description="componentone ole db data source unbound mode" />                     </class>                 </file>                 <registryvalue root="hkcr" key="clsid\{359aa0c1-ddf8-49db-83ff-6184706a9106}\refcount" value="1" type="string" action="write" />             </component>         </directoryref>     </fragment> </wix> 

here's added piece puzzle i'm running transform add addtribute pemanent="yes" component.

here transform i'm running (graciously provided forum):

<xsl:stylesheet version="1.0"   xmlns:xsl="http://www.w3.org/1999/xsl/transform"   xmlns="http://schemas.microsoft.com/wix/2006/wi"   xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">    <xsl:template match="@*|node()">     <xsl:copy>       <xsl:apply-templates select="@*|node()"/>     </xsl:copy>   </xsl:template>    <xsl:template match="wix:component">     <xsl:copy>       <xsl:apply-templates select="@*" />       <xsl:attribute name="permanent">         <xsl:text>yes</xsl:text>       </xsl:attribute>       <xsl:apply-templates select="node()" />     </xsl:copy>   </xsl:template>  </xsl:stylesheet> 

add template stylesheet:

 <xsl:template match="@relativepath"></xsl:template> 

since it's more specific, take precendence on other template copies attributes not named relativepath.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -