2016-07-05 5 views
2

熱で収穫したファイルをxsltファイルでフィルタリングしてpdbファイルをフィルタリングしようとしました。しかし、pdbファイルはまだそこにあります。私は何が欠けていますか?ここでは、ファイルは次のとおりです。xsltはpdbファイルをフィルタリングしません

<?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:wi="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:key name="pdf-search1"  match="wi:Component[contains(wi:File/@Source='$(var.StageDirXFire)', '.pdf')]" use="@Id"/> 

<xsl:template match="wi:Component[key('pdf-search1', @Id)]"/> 
<xsl:template match="wi:ComponentRef[key('pdf-search1', @Id)]"/> 

</xsl:stylesheet> 

答えて

4

<?xml version="1.0" encoding="ISO-8859-1"?> 
<xsl:stylesheet version="1.0" 
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
       xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" 
       xmlns="http://schemas.microsoft.com/wix/2006/wi" 
       exclude-result-prefixes="xsl wix"> 

    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> 

    <xsl:strip-space elements="*"/> 

    <xsl:key name="PdbToRemove" 
      match="wix:Component[contains(wix:File/@Source, '.pdb')]" 
      use="@Id" /> 

    <xsl:template match="@*|node()"> 
    <xsl:copy> 
     <xsl:apply-templates select="@*|node()"/> 
    </xsl:copy> 
    </xsl:template> 

    <xsl:template match="*[self::wix:Component or self::wix:ComponentRef] 
         [key('PdbToRemove', @Id)]" /> 
</xsl:stylesheet> 

このXSLTを試してみてください、私は本当にXSLTについて多くを知らないが、私はちょうどので、あなたが私の一つのために必要なまったく同じことを行っているために起こりましたインストーラプロジェクト。私はこのxslt(と私が取り除いた他のもの)で、しばらくの間、グーグル・グーグルで終わった。

関連する問題