diff options
author | Bob Arnson <bob@joyofsetup.com> | 2019-11-04 15:02:01 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2019-11-04 15:05:06 -0500 |
commit | efcc52fdd0d767d45497ebf54765ad6da7878c6f (patch) | |
tree | 974d40b230a25c3e33df55f83596d604fe4b29ca /src | |
parent | 2c6285da46439ec98f89f09e2029f801924014ed (diff) | |
download | wix-efcc52fdd0d767d45497ebf54765ad6da7878c6f.tar.gz wix-efcc52fdd0d767d45497ebf54765ad6da7878c6f.tar.bz2 wix-efcc52fdd0d767d45497ebf54765ad6da7878c6f.zip |
When fixing namespaceless elements, fix the whole tree.
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Converters/Wix3Converter.cs | 2 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/ConverterFixture.cs | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/WixToolset.Converters/Wix3Converter.cs b/src/WixToolset.Converters/Wix3Converter.cs index b4ce1064..faff12ee 100644 --- a/src/WixToolset.Converters/Wix3Converter.cs +++ b/src/WixToolset.Converters/Wix3Converter.cs | |||
@@ -422,7 +422,7 @@ namespace WixToolset.Converters | |||
422 | 422 | ||
423 | element.Add(new XAttribute("xmlns", WixNamespace.NamespaceName)); // set the default namespace. | 423 | element.Add(new XAttribute("xmlns", WixNamespace.NamespaceName)); // set the default namespace. |
424 | 424 | ||
425 | foreach (var elementWithoutNamespace in element.Elements().Where(e => XNamespace.None == e.Name.Namespace)) | 425 | foreach (var elementWithoutNamespace in element.DescendantsAndSelf().Where(e => XNamespace.None == e.Name.Namespace)) |
426 | { | 426 | { |
427 | elementWithoutNamespace.Name = WixNamespace.GetName(elementWithoutNamespace.Name.LocalName); | 427 | elementWithoutNamespace.Name = WixNamespace.GetName(elementWithoutNamespace.Name.LocalName); |
428 | } | 428 | } |
diff --git a/src/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/test/WixToolsetTest.Converters/ConverterFixture.cs index e2c0be5b..fd35ae50 100644 --- a/src/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConverterFixture.cs | |||
@@ -399,12 +399,18 @@ namespace WixToolsetTest.Converters | |||
399 | "<?xml version='1.0' encoding='utf-8'?>", | 399 | "<?xml version='1.0' encoding='utf-8'?>", |
400 | "<Include>", | 400 | "<Include>", |
401 | " <?define Version = 1.2.3 ?>", | 401 | " <?define Version = 1.2.3 ?>", |
402 | " <Fragment>", | ||
403 | " <DirectoryRef Id='TARGETDIR' />", | ||
404 | " </Fragment>", | ||
402 | "</Include>"); | 405 | "</Include>"); |
403 | 406 | ||
404 | var expected = String.Join(Environment.NewLine, | 407 | var expected = String.Join(Environment.NewLine, |
405 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | 408 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", |
406 | "<Include xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 409 | "<Include xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
407 | " <?define Version = 1.2.3 ?>", | 410 | " <?define Version = 1.2.3 ?>", |
411 | " <Fragment>", | ||
412 | " <DirectoryRef Id=\"TARGETDIR\" />", | ||
413 | " </Fragment>", | ||
408 | "</Include>"); | 414 | "</Include>"); |
409 | 415 | ||
410 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 416 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |