From c5a84465192945f8cf81a2bde8e9c975504d0e76 Mon Sep 17 00:00:00 2001 From: Oleg Shilo Date: Sat, 9 Nov 2024 12:53:40 +1100 Subject: [PATCH] wix4: Issue #1667: AddDefaultNamespaces removing processing instructions --- Source/src/WixSharp/Extensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/src/WixSharp/Extensions.cs b/Source/src/WixSharp/Extensions.cs index 44f268d4..d1d8d32e 100644 --- a/Source/src/WixSharp/Extensions.cs +++ b/Source/src/WixSharp/Extensions.cs @@ -2014,9 +2014,9 @@ internal static XDocument AddDefaultNamespaces(this XDocument doc) doc.Root.RemoveAll(); - //need to add namespaces (via attributes) as well - doc.Root.Add(newRoot.Attributes()); - doc.Root.Add(newRoot.Elements()); + // Walking all nodes will pick up XProcessingInstruction too + foreach (XNode node in newRoot.Nodes()) + doc.Root.Add(node); } return doc; }