Write a wix extension which handles elements in that XML namespace. The following example extension will cause any elements in the namespace http://www.example.com
to be ignored:
Save the following code in mywixext.cs
:
using System.Xml.Schema;
using Microsoft.Tools.WindowsInstallerXml;
using System.Xml;
[assembly: AssemblyDefaultWixExtension(
typeof(mywixext.IgnoreNamespaceWixExtension))]
namespace mywixext
{
public class IgnoreNamespaceWixExtension : WixExtension
{
public override CompilerExtension CompilerExtension
{
get
{
return new IgnoreNamespaceCompilerExtension();
}
}
}
public class IgnoreNamespaceCompilerExtension : CompilerExtension
{
public override XmlSchema Schema
{
get
{
return new XmlSchema()
{
TargetNamespace = "http://www.example.com"
};
}
}
public override void ParseElement(
SourceLineNumberCollection sourceLineNumbers,
XmlElement parentElement, XmlElement element,
params string[] contextValues)
{
// do nothing
}
}
}
Now compile it into mywixext.dll
like this:
"c:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /t:library ^
/r:"c:\program files\windows installer xml v3\bin\wix.dll" ^
mywixext.cs
If you now compile your wix sources with the option -ext mywixext.dll
(or do the equivalent in votive) then all elements in the http://www.example.com
namespace will be ignored.
edit: I was imprecise when I said that any element would be ignored. The WIX XML schema does not allow you to add your own child elements directly under the WIX
element. Most other elements allow it. Look for the text <xs:any namespace="##other" processContents="lax">
in c:\program files\windows installer xml v3\doc\wix.xsd
to find the extensibility points.