wix xslt for adding node
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的更多相关文章
- 在openshift上自定义node.js的版本
https://github.com/ramr/nodejs-custom-version-openshift 由于是线上服务器,一步一步来: 先把上面的工程拉下来,覆盖到初始化的工程里,提交,让服务 ...
- 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 ...
- redis 学习笔记(6)-cluster集群搭建
上次写redis的学习笔记还是2014年,一转眼已经快2年过去了,在段时间里,redis最大的变化之一就是cluster功能的正式发布,以前要搞redis集群,得借助一致性hash来自己搞shardi ...
- Redis集群研究和实践(基于redis 3.0.5)
前言 redis 是我们目前大规模使用的缓存中间件,由于它强大高效而又便捷的功能,得到了广泛的使用.现在的2.x的稳定版本是2.8.19,也是我们项目中普遍用到的版本. redis在年初发布了3.0. ...
- 分布式缓存技术redis学习系列(四)——redis高级应用(集群搭建、集群分区原理、集群操作)
本文是redis学习系列的第四篇,前面我们学习了redis的数据结构和一些高级特性,点击下面链接可回看 <详细讲解redis数据结构(内存模型)以及常用命令> <redis高级应用( ...
- ocfs2: 搭建环境
OCFS2是基于共享磁盘的集群文件系统,它在一块共享磁盘上创建OCFS2文件系统,让集群中的其它节点可以对磁盘进行读写操作.OCFS2由两部分内容构成,一部分实现文件系统功能,位于VFS之下和Ext4 ...
- redis集群配置
客户端分片 程序端实现 代理proxy,访问proxy,proxy指定redis保存位置. Twemproxy Redis cluster ,会造成一部分数据丢失,无中心化1.将数据自动切分(spli ...
- memcache的一致性hash算法使用
一.概述 1.我们的memcache客户端(这里我看的spymemcache的源码),使用了一致性hash算法ketama进行数据存储节点的选择.与常规的hash算法思路不同,只是对我们要存储数据的k ...
- redis3.0 集群实战2 - 集群功能实战
1 集群基本操作 1.1 查看当前集群状态 使用redis-trib.rb check功能查看对应的节点的状态: [root@bogon bin]# ./redis-trib.rb check 1 ...
随机推荐
- 深入学习PHP内核
http://www.php-internals.com/ 深入学习PHP内核 http://www.php-internals.com/book/ http://www.kancloud.cn/@ ...
- java Servlet接口及应用
基本类和接口 一.javax.servlet.Servlet接口 servlet抽象集是javax.servlet.Servlet接口,它规定了必须由Servlet类实现由servlet引擎识别和管理 ...
- RAID设备
RAID(Redundant Array of Independent Disk),独立冗余磁盘阵列(通常简称磁盘阵列).磁盘阵列的实质是将多个磁盘通过RAID控制器组合在一起,形成一个新的磁盘.这个 ...
- 【PHP代码审计】 那些年我们一起挖掘SQL注入 - 6.全局防护Bypass之一些函数的错误使用
0x01 背景 PHP程序员在开发过程中难免会使用一些字符替换函数(str_replace).反转义函数(stripslashes),但这些函数使用位置不当就会绕过全局的防护造成SQL注入漏洞. 0x ...
- The Last Practice
Problem Description Tomorrow is contest day, Are you all ready?We have been training for 45 days, an ...
- Java基础知识强化之IO流笔记82:NIO之 Pipe(管道)
1. Java NIO 管道是2个线程之间的单向数据连接.Pipe有一个source通道和一个sink通道.数据会被写到sink通道,从source通道读取. 这里是Pipe原理的图示: 2. Pip ...
- (转)MySql开启远程连接权限
命令行登陆: mysql -u root -p 不行的话可以从MySql.exe进入,找到Mysql根目录中路径类似:"MySQL\bin\mysql.exe",这样: D:\We ...
- hdu 4010 Query on The Trees LCT
支持:1.添加边 x,y2.删边 x,y3.对于路径x,y上的所有节点的值加上w4.询问路径x,y上的所有节点的最大权值 分析:裸的lct...rev忘了清零死循环了两小时... 1:就是link操作 ...
- 使用开源库MagicalRecord操作CoreData
1. 将 MagicalRecord 文件夹拖入到工程文件中,引入 CoreData.frame 框架 2. 在 .pch 文件中引入头文件 CoreData+MagicalRecord.h 注: ...
- 【.NET基础】--委托、事件、线程(3)
之前的两篇文章我们了解了委托和事件,本文我们看一下线程. 1,一个窗体程序,默认拥有一个线程(相当于一个商店里面,只有一个店员),这个默认的线程叫做 UI线程/主线程. 2,进程和线程的关系: A,进 ...