Using xslt to add new node item to wix source code.

Original wix code:

  <Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Guid="*" Id="Test.txt">
<File KeyPath="yes" Source="$(var.TestFolder)\Test.txt" Id="Test.txt" />
</Component>
</DirectoryRef>
</Fragment>

Add <CopyFile /> node inside <File> node, the expected wix code would be:

  <Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Guid="*" Id="Test.txt">
<File KeyPath="yes" Source="$(var.TestFolder)\Test.txt" Id="Test.txt" >
<CopyFile Id ="Test.txt" DestinationProperty="BinFolder" DestinationName="test.txt" />
</File>
</Component>
</DirectoryRef>
</Fragment>

Pass this xslt to heat.exe with -t option should do the work:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wi="http://schemas.microsoft.com/wix/2006/wi" exclude-result-prefixes="wi">
<xsl:output method="xml" indent="yes"/> <xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template> <xsl:template match="wi:File">
<xsl:copy>
<xsl:variable name="leadingSpace" select="preceding-sibling::text()[1]" />
<xsl:apply-templates select="@*"/>
<!-- Add linebreak and indentation, as requested in the comments -->
<xsl:value-of select="concat($leadingSpace, ' ')" />
<CopyFile xmlns="http://schemas.microsoft.com/wix/2006/wi" Id="Test.txt" DestinationProperty="BinFolder" DestinationName="test.txt"/>
<!-- Linebreak and indentation -->
<xsl:value-of select="$leadingSpace"/>
</xsl:copy>
</xsl:template> </xsl:stylesheet>

wix xslt for adding node的更多相关文章

  1. 在openshift上自定义node.js的版本

    https://github.com/ramr/nodejs-custom-version-openshift 由于是线上服务器,一步一步来: 先把上面的工程拉下来,覆盖到初始化的工程里,提交,让服务 ...

  2. Using XSLT and Open XML to Create a Word 2007 Document

    Summary: Learn how to transform XML data into a Word 2007 document by starting with an existing docu ...

  3. redis 学习笔记(6)-cluster集群搭建

    上次写redis的学习笔记还是2014年,一转眼已经快2年过去了,在段时间里,redis最大的变化之一就是cluster功能的正式发布,以前要搞redis集群,得借助一致性hash来自己搞shardi ...

  4. Redis集群研究和实践(基于redis 3.0.5)

    前言 redis 是我们目前大规模使用的缓存中间件,由于它强大高效而又便捷的功能,得到了广泛的使用.现在的2.x的稳定版本是2.8.19,也是我们项目中普遍用到的版本. redis在年初发布了3.0. ...

  5. 分布式缓存技术redis学习系列(四)——redis高级应用(集群搭建、集群分区原理、集群操作)

    本文是redis学习系列的第四篇,前面我们学习了redis的数据结构和一些高级特性,点击下面链接可回看 <详细讲解redis数据结构(内存模型)以及常用命令> <redis高级应用( ...

  6. ocfs2: 搭建环境

    OCFS2是基于共享磁盘的集群文件系统,它在一块共享磁盘上创建OCFS2文件系统,让集群中的其它节点可以对磁盘进行读写操作.OCFS2由两部分内容构成,一部分实现文件系统功能,位于VFS之下和Ext4 ...

  7. redis集群配置

    客户端分片 程序端实现 代理proxy,访问proxy,proxy指定redis保存位置. Twemproxy Redis cluster ,会造成一部分数据丢失,无中心化1.将数据自动切分(spli ...

  8. memcache的一致性hash算法使用

    一.概述 1.我们的memcache客户端(这里我看的spymemcache的源码),使用了一致性hash算法ketama进行数据存储节点的选择.与常规的hash算法思路不同,只是对我们要存储数据的k ...

  9. redis3.0 集群实战2 - 集群功能实战

    1 集群基本操作   1.1 查看当前集群状态 使用redis-trib.rb check功能查看对应的节点的状态: [root@bogon bin]# ./redis-trib.rb check 1 ...

随机推荐

  1. jq实现地址级联效果

    (function ($) { $.fn.Address = function (options) { var defaults = { divid: "Address", cal ...

  2. c#高效的线程安全队列ConcurrentQueue<T>(上)

      ConcurrentQueue<T>队列是一个高效的线程安全的队列,是.Net Framework 4.0,System.Collections.Concurrent命名空间下的一个数 ...

  3. 管理和维护RHCS集群

    导读 管理和维护RHCS集群是一个非常复杂和繁琐的工作,要维护好一个RHCS集群,必须熟悉RHCS的基本运行原理,在集群管理方面,RHCS提供了两种方式:即Luci图形界面方式和命令行方式,这儿重点讲 ...

  4. BootStrap2学习日记15----选项卡

    导航格式1: <ul class="nav nav-tabs"> <li class="active"><a href=" ...

  5. Subsequence poj 3061 二分(nlog n)或尺取法(n)

    Subsequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9236   Accepted: 3701 Descr ...

  6. 通过uiview动画来放大图片

    UIImage *image=[UIImage imageNamed:"]; UIImageView *imageView=[[UIImageView alloc]init]; imageV ...

  7. 【Android 界面效果44】Android之圆头像实例

    在很多应用中,我们看到,个人主页里面的头像一般都是圆的,设计成圆的会使整个界 面布 局变的优雅漂亮.那么,怎么使头像变圆呢?有的人说可以在上面加一个中间为透明圆形的png图,用它来遮盖住头像不就行了嘛 ...

  8. 一些英文面试题(Android)

    Describe the APK format. The APK file is compressed the AndroidManifest.xml file, application code ( ...

  9. 如何使上层的div遮住的链接可以点击

    pointer-events属性 http://www.css88.com/book/css/properties/user-interface/pointer-events.htm 在上层的div中 ...

  10. (Android学习系列)二,窗口(Activity)的生命周期

    在Activity从创建到销毁的过程中需要在不同的阶段调用7个生命周期的方法这7个生命周期方法定义如下: protected void onCreate(Bundle savedInstanceSta ...