I saw the post XSLT : Add a namespace declaration to the root element
The @StuartLC answer works. I need help ... in the example @schglurps... ¿How would you add a new namespace to a non-root node?
The input 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>
And I'd want to obtain:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="AcquisitionFolder" xmlns:ns1="http://prerk">
<Directory Id="dir2EE87E668A6861A2C8B6528214144568" Name="bin" />
<Directory Id="dir99C9EB95694B90A2CD31AD7E2F4BF7F6" Name="Decoders" />
<ns1:dir>prueba</ns1:dir>
</DirectoryRef>
</Fragment>
</Wix>
A new namespace in the node DirectoryRef
(eg) xmlns:ns1="http://prerk"
, it is a non root and copies all the same nodes.
I tried, but I couldn't find any suitable solution.
Could you please advise me?