Qui*_*zer 2 xml xslt windows-installer wix heat
我想用XSLT来编辑它从产生.wxs文件heat在威克斯
这是components_en_us.wxs
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="CLASSES">
<Directory Id="dirAB609E465A12655D740B32B2BA26C468" Name="alfresco">
<Directory Id="dir68A1A3CC25353B021B1D7D979B520AF0" Name="extension">
<Component Id="cmp0FAE663628DD6BAE53501BB26264259B" Guid="1CBE6568-96E5-4844-BF02-99AF0DE1719D">
<File Id="fil867FDB2D2761B5912BA54F92F5E928D1" KeyPath="yes" Source="SourceDir\alfresco\extension\web-client-config-custom.xml" />
</Component>
</Directory>
</Directory>
</DirectoryRef>
</Fragment>
</Wix>
Run Code Online (Sandbox Code Playgroud)
但问题是我有其他.wxs文件(其他语言的components_xx_yy.wxs)和组件/文件ID是相同的.如果我使用这种方法编译,我将收到一个错误
error LGHT0091 : Duplicate symbol 'Component:cmp0FAE663628DD6BAE53501BB26264259B' found.
This typically me ans that an Id is duplicated. Check to make sure all your identifiers
of a given type (File, Component, Feature) are unique.
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索,发现我可以使用xslt更改components_en_us.wxs中的组件/文件ID
所以,我希望有类似的东西
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="CLASSES">
<Directory Id="dirAB609E465A12655D740B32B2BA26C468" Name="alfresco">
<Directory Id="dir68A1A3CC25353B021B1D7D979B520AF0" Name="extension">
<Component Id="en_US_cmp0FAE663628DD6BAE53501BB26264259B" Guid="1CBE6568-96E5-4844-BF02-99AF0DE1719D">
<File Id="fil867FDB2D2761B5912BA54F92F5E928D1" KeyPath="yes" Source="SourceDir\alfresco\extension\web-client-config-custom.xml" />
</Component>
</Directory>
</Directory>
</DirectoryRef>
</Fragment>
</Wix>
Run Code Online (Sandbox Code Playgroud)
现在,我有另一个问题的xslt,但我不知道如何实现它,就像我想要的那样.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
所以,请纠正我,如果我的理解是错误的,请帮助我.xslt
提前致谢
编辑:这是一种最佳实践,还是应该采取其他措施来解决此重复错误.
我可以在这两个XML列表之间找到的唯一变化是在组件ID之前添加了"en_US_".这是全部吗?如果是这样,请尝试将此模板添加到当前的XSLT文件中:
<xsl:template match="wix:Component/@Id">
<xsl:attribute name="{name()}">
<xsl:value-of select="concat('en_US_', .)" />
</xsl:attribute>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1231 次 |
| 最近记录: |