I have this XML document :
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="AcquisitionFolder">
<Directory Id="dir2EE87E668A6861A2C8B6528214144568" Name="bin" />
<Directory Id="dir99C9EB95694B90A2CD31AD7E2F4BF7F6" Name="Decoders" />
</DirectoryRef>
</Fragment>
</Wix>
I'd like to obtain the following result :
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension>
<Fragment>
<DirectoryRef Id="AcquisitionFolder">
<Directory Id="dir2EE87E668A6861A2C8B6528214144568" Name="bin" />
<Directory Id="dir99C9EB95694B90A2CD31AD7E2F4BF7F6" Name="Decoders" />
</DirectoryRef>
</Fragment>
</Wix>
It seems a simple problem, but I didn't find the solution :-( I made several attempts, and found several similar questions (this one for example : XSLT: Add namespace to root element), but they didn't help me.
Thanks for any advice !!!
In many cases, you can simply embed the namespace into the projected Xml elements (including root) as part of a Literal Result Element:
More formally / generally, any namespaces in your output xml can be added into the stylesheet's own declaration (either globally, or using a namespace alias), e.g.
... and then referenced in the output
If there are unwanted / unused namespaces residual in the resultant output (e.g. needed in the source document, but not in the output document), you are able able to clean these out with
exclude-result-prefixes