Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3877442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:29:53+00:00 2026-05-19T22:29:53+00:00

I am building a Wix installer that is based on a set of auto-generated

  • 0

I am building a Wix installer that is based on a set of auto-generated XML files (I use HEAT to harvest folder content). I need to exclude certain files from a resulting XML, for example, from this fragment I want to exclude a file “Web.config”:

<Component Id="cmp87E809324190AF5E85315B10C397DB8F" 
           Directory="Content" 
           Guid="{4210C091-E16F-45EA-9005-A7487CF6AC69}">
   <File Id="fil13DABBB8A7FACF8E81FE69FD2464DE48" 
         Source="$(var.ProjectDir)\MyService.svc" />
</Component>
<Component Id="cmp276C007DCB38D3C2E4DA41DFDD8F5CED" 
           Directory="Content" 
           Guid="{A01BE50E-3B00-40EF-96EB-D48AED1F6259}">
   <File Id="fil527A2DD913A88F35BD2B90F10029FB32" 
         Source="$(var.ProjectDir)\Web.config" />
</Component>

I apply the following transformation:

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

  <!-- exclude files -->
  <xsl:template match="wix:Component/wix:File[
                          @Source='$(var.ProjectDir)\Web.config'
                       ]">
  </xsl:template>

Unfortunately it only removes the “File” element (the one it matches), I would like to remove the parent element (“Component”) for the matched “File” sub-element. This must be relatively easy in XSLT, but I haven’t figured it out.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:29:54+00:00Added an answer on May 19, 2026 at 10:29 pm

    You should use:

    <!-- exclude files -->
    <xsl:template match="
            Component[File/@Source='$(var.ProjectDir)\Web.config']"/>
    

    Namespaces are missing in your sample XML, so you can add them yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have our WiX installer that is currently building on a build
At work we use WiX for building installation packages. We want that installation of
I'm building my first WiX installer after becoming sick of the sight of Wise
I am building a simple installer for a web application using Wix. I wish
Building a commercial product may use various open source libraries that have use of
I'm building an installer using WiX (not keyworded since WiX is not the problem
I've built an installer using WiX 3.0. The installer contains additional installers that can
I've struggled through building a new WiX installer, and I'm really happy with it,
My installer, created wth WiX is localized via .wxl files. It is possible in
WiX first timer here. I am building an installer for my product using WiX,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.