2
A
回答
4
對由熱生成的片段應用XSLT轉換,並將ReadOnly="yes"
添加到每個File
元素。此XSLT執行以下操作:
<?xml version="1.0" encoding="UTF-8"?>
<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="wix:File">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:attribute name="ReadOnly">
<xsl:text>yes</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="*" />
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="* | text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@* | text()">
<xsl:copy />
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
相關問題
- 1. TextArea - 使用CSS將readonly屬性設置爲true
- 2. 如何爲JVM設置自定義系統變量來訪問屬性文件?
- 3. 如何創建maven配置文件來設置系統屬性
- 4. 使用junitPlatform時設置系統屬性
- 5. 設置系統屬性
- 6. 如何設置log4j.configuration文件系統屬性在UNIX
- 7. -Dmaven.multiModuleProjectDirectory系統屬性爲沒有設置
- 8. 爲RCP程序設置系統屬性
- 9. 如何使用Gradle命令行設置Java系統屬性?
- 10. 將UIManager中的FileChooserUI屬性設置爲系統的
- 11. 如何只爲編輯網格窗口列設置readonly屬性?
- 12. 設置系統屬性Spring配置文件
- 13. 如何使用PowerShell刪除文件上的ReadOnly屬性?
- 14. 將HtmlEditorExtender設置爲ReadOnly
- 15. 如何爲Tomcat設置系統屬性6.X
- 16. 如何在VB.NET中使用RhinoMocks爲readonly屬性設置返回值?
- 17. 如何將Node.js文件系統設置爲離子項目
- 18. 春屬性文件VS系統屬性
- 19. 如何使用CMake有條件地爲OpenCV dylib文件設置屬性?
- 20. 如何從msbuild文件中的teamcity獲取系統屬性?
- 21. 如何在Spring中加載屬性文件位置的系統屬性
- 22. 將.yml文件中的所有彈簧引導屬性設置爲系統屬性
- 23. 哪裏可以設置系統屬性
- 24. 從代碼設置系統屬性。
- 25. 未設置SBT系統屬性
- 26. 在.gradle文件中設置gradle系統屬性
- 27. 如何使用as3.0爲文件設置新屬性
- 28. PowerShell列表遞歸地將文件屬性設置爲csv
- 29. 設置使用user.dir系統屬性中的JBoss 5.1
- 30. 使用命令行的Java設置系統屬性
對於XML虛擬:您如何應用此轉換? – harper 2012-01-13 17:22:32
@harper你必須使用一個變形器,例如[Xalan](http://xml.apache.org/xalan-j/)或[Saxon](http://saxon.sourceforge.net/ )。這兩個都是Java應用程序。由於這一步是構建過程,因此可以使用[Ant](http://ant.apache.org/)的[XSLT任務](http://ant.apache.org/manual/Tasks/style)。 HTML)。還有其他工具。 – 2012-01-13 19:41:44
這是一個簡單的C#表單應用程序來轉換XML http://www.daniweb.com/software-development/csharp/threads/308973/xml-transformer – 2014-06-12 14:05:26