Do *not* require XML declaration
Rob Mensching committed
Jun 23, 2020 at 16:43 UTC
acba90f005779fa03ee05c3c87148bb6141ba60e
16 files changed
+58
-111
src/WixToolset.Converters/Wix3Converter.cs
+32
-16
@@ -203,9 +203,9 @@ namespace WixToolset.Converters
203
{
204
try
205
{
206
- using (var writer = File.CreateText(this.SourceFile))
206
+ using (var writer = XmlWriter.Create(this.SourceFile, new XmlWriterSettings { OmitXmlDeclaration = true }))
207
{
208
- document.Save(writer, SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces);
208
+ document.Save(writer);
209
}
210
}
211
catch (UnauthorizedAccessException)
@@ -228,26 +228,17 @@ namespace WixToolset.Converters
228
229
var declaration = document.Declaration;
230
231
- // Convert the declaration.
231
+ // Remove the declaration.
232
if (null != declaration)
233
{
234
- if (!String.Equals("utf-8", declaration.Encoding, StringComparison.OrdinalIgnoreCase))
234
+ if (this.OnError(ConverterTestType.DeclarationPresent, null, "This file contains an XML declaration on the first line."))
235
{
236
- if (this.OnError(ConverterTestType.DeclarationEncodingWrong, document.Root, "The XML declaration encoding is not properly set to 'utf-8'."))
237
- {
238
- declaration.Encoding = "utf-8";
239
- }
240
- }
241
- }
242
- else // missing declaration
243
- {
244
- if (this.OnError(ConverterTestType.DeclarationMissing, null, "This file is missing an XML declaration on the first line."))
245
- {
246
- document.Declaration = new XDeclaration("1.0", "utf-8", null);
247
- document.Root.AddBeforeSelf(new XText(XDocumentNewLine.ToString()));
236
+ document.Declaration = null;
237
}
238
}
239
240
+ TrimLeadingText(document);
241
+
242
// Start converting the nodes at the top.
243
this.ConvertNodes(document.Nodes(), 0);
244
@@ -903,6 +894,26 @@ namespace WixToolset.Converters
894
return !String.IsNullOrEmpty(value);
895
}
896
897
+ private static bool IsTextNode(XNode node, out XText text)
898
+ {
899
+ text = null;
900
+
901
+ if (node.NodeType == XmlNodeType.Text || node.NodeType == XmlNodeType.CDATA)
902
+ {
903
+ text = (XText)node;
904
+ }
905
+
906
+ return text != null;
907
+ }
908
+
909
+ private static void TrimLeadingText(XDocument document)
910
+ {
911
+ while (IsTextNode(document.Nodes().FirstOrDefault(), out var text))
912
+ {
913
+ text.Remove();
914
+ }
915
+ }
916
+
917
private static string TrimTextValue(XText text)
918
{
919
var value = text.Value;
@@ -1052,6 +1063,11 @@ namespace WixToolset.Converters
1063
/// Explicit auto-GUID unnecessary.
1064
/// </summary>
1065
AutoGuidUnnecessary,
1066
+
1067
+ /// <summary>
1068
+ /// Displayed when the XML declaration is present in the source file.
1069
+ /// </summary>
1070
+ DeclarationPresent,
1071
}
1072
}
1073
}
src/test/WixToolsetTest.Converters/BaseConverterFixture.cs
+6
-10
@@ -5,6 +5,7 @@ namespace WixToolsetTest.Converters
5
using System;
6
using System.IO;
7
using System.Text;
8
+ using System.Xml;
9
using System.Xml.Linq;
10
using Xunit;
11
@@ -15,23 +16,18 @@ namespace WixToolsetTest.Converters
16
var sb = new StringBuilder();
17
18
using (var writer = new StringWriter(sb))
19
+ using (var xml = XmlWriter.Create(writer, new XmlWriterSettings { OmitXmlDeclaration = true }))
20
{
19
- document.Save(writer, SaveOptions.DisableFormatting);
21
+ document.Save(xml);
22
}
23
22
- return sb.ToString();
24
+ return sb.ToString().TrimStart();
25
}
26
27
protected static string[] UnformattedDocumentLines(XDocument document)
28
{
27
- var sb = new StringBuilder();
28
-
29
- using (var writer = new StringWriter(sb))
30
- {
31
- document.Save(writer, SaveOptions.DisableFormatting);
32
- }
33
-
34
- return sb.ToString().Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
29
+ var unformatted = UnformattedDocumentString(document);
30
+ return unformatted.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
31
}
32
33
protected static void CompareLineByLine(string[] expectedLines, string[] actualLines)
src/test/WixToolsetTest.Converters/ConditionFixture.cs
+3
-7
@@ -29,7 +29,6 @@ namespace WixToolsetTest.Converters
29
30
var expected = new[]
31
{
32
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
32
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
33
" <Fragment>",
34
" <UI>",
@@ -70,7 +69,6 @@ namespace WixToolsetTest.Converters
69
70
var expected = new[]
71
{
73
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
72
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
73
" <Fragment>",
74
" <Component Id=\"Comp1\" Directory=\"ApplicationFolder\" Condition=\"1<2\">",
@@ -107,7 +105,6 @@ namespace WixToolsetTest.Converters
105
106
var expected = new[]
107
{
110
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
108
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
109
" <Fragment>",
110
" <Feature Id=\"Feature1\">",
@@ -144,7 +141,6 @@ namespace WixToolsetTest.Converters
141
142
var expected = new[]
143
{
147
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
144
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
145
" <Fragment>",
146
" <Launch Condition=\"1<2\" Message=\"Stop the install\" />",
@@ -168,7 +164,7 @@ namespace WixToolsetTest.Converters
164
public void FixPermissionExCondition()
165
{
166
var parse = String.Join(Environment.NewLine,
171
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
167
+ "<!-- comment -->",
168
"<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>",
169
" <Fragment>",
170
" <Component Id='Comp1' Guid='*' Directory='ApplicationFolder'>",
@@ -181,7 +177,7 @@ namespace WixToolsetTest.Converters
177
178
var expected = new[]
179
{
184
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
180
+ "<!-- comment -->",
181
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
182
" <Fragment>",
183
" <Component Id=\"Comp1\" Directory=\"ApplicationFolder\">",
@@ -199,7 +195,7 @@ namespace WixToolsetTest.Converters
195
var converter = new Wix3Converter(messaging, 2, null, null);
196
197
var errors = converter.ConvertDocument(document);
202
- Assert.Equal(4, errors);
198
+ Assert.Equal(3, errors);
199
200
var actualLines = UnformattedDocumentLines(document);
201
CompareLineByLine(expected, actualLines);
src/test/WixToolsetTest.Converters/ConverterFixture.cs
+12
-49
@@ -13,15 +13,15 @@ namespace WixToolsetTest.Converters
13
private static readonly XNamespace Wix4Namespace = "http://wixtoolset.org/schemas/v4/wxs";
14
15
[Fact]
16
- public void EnsuresDeclaration()
16
+ public void EnsuresNoDeclaration()
17
{
18
var parse = String.Join(Environment.NewLine,
19
+ "<?xml version='1.0' encoding='utf-8'?>",
20
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
21
" <Fragment />",
22
"</Wix>");
23
24
var expected = String.Join(Environment.NewLine,
24
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
25
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
26
" <Fragment />",
27
"</Wix>");
@@ -39,27 +39,6 @@ namespace WixToolsetTest.Converters
39
Assert.Equal(expected, actual);
40
}
41
42
- [Fact]
43
- public void EnsuresUtf8Declaration()
44
- {
45
- var parse = String.Join(Environment.NewLine,
46
- "<?xml version='1.0'?>",
47
- "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
48
- " <Fragment />",
49
- "</Wix>");
50
-
51
- var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
52
-
53
- var messaging = new MockMessaging();
54
- var converter = new Wix3Converter(messaging, 4, null, null);
55
-
56
- var errors = converter.ConvertDocument(document);
57
-
58
- Assert.Equal(1, errors);
59
- Assert.Equal("1.0", document.Declaration.Version);
60
- Assert.Equal("utf-8", document.Declaration.Encoding);
61
- }
62
-
42
[Fact]
43
public void CanFixWhitespace()
44
{
@@ -74,7 +53,6 @@ namespace WixToolsetTest.Converters
53
"</Wix>");
54
55
var expected = String.Join(Environment.NewLine,
77
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
56
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
57
" <Fragment>",
58
" <Property Id=\"Prop\" Value=\"Val\" />",
@@ -91,7 +69,7 @@ namespace WixToolsetTest.Converters
69
var actual = UnformattedDocumentString(document);
70
71
Assert.Equal(expected, actual);
94
- Assert.Equal(4, errors);
72
+ Assert.Equal(5, errors);
73
}
74
75
[Fact]
@@ -108,7 +86,6 @@ namespace WixToolsetTest.Converters
86
"</Wix>");
87
88
var expected = String.Join(Environment.NewLine,
111
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
89
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
90
" <Fragment>",
91
"",
@@ -127,14 +104,13 @@ namespace WixToolsetTest.Converters
104
var actual = UnformattedDocumentString(document);
105
106
Assert.Equal(expected, actual);
130
- Assert.Equal(3, conversions);
107
+ Assert.Equal(4, conversions);
108
}
109
110
[Fact]
111
public void CanConvertWithNewLineAtEndOfFile()
112
{
113
var parse = String.Join(Environment.NewLine,
137
- "<?xml version='1.0' encoding='utf-8'?>",
114
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
115
" <Fragment>",
116
"",
@@ -145,7 +121,6 @@ namespace WixToolsetTest.Converters
121
"");
122
123
var expected = String.Join(Environment.NewLine,
148
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
124
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
125
" <Fragment>",
126
"",
@@ -178,7 +153,6 @@ namespace WixToolsetTest.Converters
153
"</Wix>");
154
155
var expected = String.Join(Environment.NewLine,
181
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
156
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
157
" <Fragment />",
158
"</Wix>");
@@ -192,7 +166,7 @@ namespace WixToolsetTest.Converters
166
167
var actual = UnformattedDocumentString(document);
168
195
- Assert.Equal(1, errors);
169
+ Assert.Equal(2, errors);
170
//Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
171
Assert.Equal(expected, actual);
172
}
@@ -207,7 +181,6 @@ namespace WixToolsetTest.Converters
181
"</w:Wix>");
182
183
var expected = String.Join(Environment.NewLine,
210
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
184
"<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\">",
185
" <w:Fragment />",
186
"</w:Wix>");
@@ -221,7 +194,7 @@ namespace WixToolsetTest.Converters
194
195
var actual = UnformattedDocumentString(document);
196
224
- Assert.Equal(1, errors);
197
+ Assert.Equal(2, errors);
198
Assert.Equal(expected, actual);
199
Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w"));
200
}
@@ -238,7 +211,6 @@ namespace WixToolsetTest.Converters
211
"</w:Wix>");
212
213
var expected = String.Join(Environment.NewLine,
241
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
214
"<w:Wix xmlns:w=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns=\"http://wixtoolset.org/schemas/v4/wxs/util\">",
215
" <w:Fragment>",
216
" <Test />",
@@ -255,7 +227,7 @@ namespace WixToolsetTest.Converters
227
var actual = UnformattedDocumentString(document);
228
229
Assert.Equal(expected, actual);
258
- Assert.Equal(2, errors);
230
+ Assert.Equal(3, errors);
231
Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w"));
232
Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace());
233
}
@@ -270,7 +242,6 @@ namespace WixToolsetTest.Converters
242
"</Wix>");
243
244
var expected = String.Join(Environment.NewLine,
273
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
245
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\" xmlns:util=\"http://wixtoolset.org/schemas/v4/wxs/util\">",
246
" <Fragment />",
247
"</Wix>");
@@ -284,7 +255,7 @@ namespace WixToolsetTest.Converters
255
256
var actual = UnformattedDocumentString(document);
257
287
- Assert.Equal(2, errors);
258
+ Assert.Equal(3, errors);
259
Assert.Equal(expected, actual);
260
Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
261
}
@@ -299,7 +270,6 @@ namespace WixToolsetTest.Converters
270
"</Wix>");
271
272
var expected = String.Join(Environment.NewLine,
302
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
273
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
274
" <Fragment />",
275
"</Wix>");
@@ -313,7 +283,7 @@ namespace WixToolsetTest.Converters
283
284
var actual = UnformattedDocumentString(document);
285
316
- Assert.Equal(1, errors);
286
+ Assert.Equal(2, errors);
287
Assert.Equal(expected, actual);
288
Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
289
}
@@ -333,7 +303,6 @@ namespace WixToolsetTest.Converters
303
"</Include>");
304
305
var expected = String.Join(Environment.NewLine,
336
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
306
"<Include xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
307
" <?define Version = 1.2.3 ?>",
308
" <Fragment>",
@@ -352,7 +321,7 @@ namespace WixToolsetTest.Converters
321
322
var actual = UnformattedDocumentString(document);
323
355
- Assert.Equal(1, errors);
324
+ Assert.Equal(2, errors);
325
Assert.Equal(expected, actual);
326
Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace());
327
}
@@ -367,7 +336,6 @@ namespace WixToolsetTest.Converters
336
"</Wix>");
337
338
var expected = String.Join(Environment.NewLine,
370
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
339
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
340
" <File Id=\"foo.txt\" Source=\"path\\to\\foo.txt\" />",
341
"</Wix>");
@@ -381,7 +349,7 @@ namespace WixToolsetTest.Converters
349
350
var actual = UnformattedDocumentString(document);
351
384
- Assert.Equal(1, errors);
352
+ Assert.Equal(2, errors);
353
Assert.Equal(expected, actual);
354
}
355
@@ -395,7 +363,6 @@ namespace WixToolsetTest.Converters
363
"</Wix>");
364
365
var expected = String.Join(Environment.NewLine,
398
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
366
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
367
" <Directory Name=\"iamshort\" />",
368
"</Wix>");
@@ -409,7 +376,7 @@ namespace WixToolsetTest.Converters
376
377
var actual = UnformattedDocumentString(document);
378
412
- Assert.Equal(1, errors);
379
+ Assert.Equal(2, errors);
380
Assert.Equal(expected, actual);
381
}
382
@@ -417,13 +384,11 @@ namespace WixToolsetTest.Converters
384
public void CanConvertSuppressSignatureValidationNo()
385
{
386
var parse = String.Join(Environment.NewLine,
420
- "<?xml version='1.0' encoding='utf-8'?>",
387
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
388
" <MsiPackage SuppressSignatureValidation='no' />",
389
"</Wix>");
390
391
var expected = String.Join(Environment.NewLine,
426
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
392
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
393
" <MsiPackage EnableSignatureValidation=\"yes\" />",
394
"</Wix>");
@@ -445,13 +410,11 @@ namespace WixToolsetTest.Converters
410
public void CanConvertSuppressSignatureValidationYes()
411
{
412
var parse = String.Join(Environment.NewLine,
448
- "<?xml version='1.0' encoding='utf-8'?>",
413
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
414
" <Payload SuppressSignatureValidation='yes' />",
415
"</Wix>");
416
417
var expected = String.Join(Environment.NewLine,
454
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
418
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
419
" <Payload />",
420
"</Wix>");
src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs
+1
-1
@@ -58,7 +58,7 @@ namespace WixToolsetTest.Converters
58
var converter = new Wix3Converter(messaging, 4);
59
var errors = converter.ConvertFile(targetFile, true);
60
61
- Assert.Equal(6, errors);
61
+ Assert.Equal(7, errors);
62
63
var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n");
64
var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n");
src/test/WixToolsetTest.Converters/CustomActionFixture.cs
+2
-4
@@ -24,7 +24,6 @@ namespace WixToolsetTest.Converters
24
"</Wix>");
25
26
var expected = String.Join(Environment.NewLine,
27
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
27
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
28
" <CustomAction Id=\"Foo\" BinaryKey=\"Wix4UtilCA_X86\" DllEntry=\"WixQuietExec\" />",
29
" <CustomAction Id=\"Foo\" BinaryKey=\"Wix4UtilCA_X64\" DllEntry=\"WixQuietExec64\" />",
@@ -41,7 +40,7 @@ namespace WixToolsetTest.Converters
40
41
var actual = UnformattedDocumentString(document);
42
44
- Assert.Equal(6, errors);
43
+ Assert.Equal(7, errors);
44
Assert.Equal(expected, actual);
45
}
46
@@ -60,7 +59,6 @@ namespace WixToolsetTest.Converters
59
"</Wix>");
60
61
var expected = String.Join(Environment.NewLine,
63
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
62
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
63
" <CustomAction Id=\"Foo\" Script=\"jscript\" ScriptFile=\"Foo.js\" />",
64
"</Wix>");
@@ -80,7 +78,7 @@ namespace WixToolsetTest.Converters
78
79
var actual = UnformattedDocumentString(document);
80
83
- Assert.Equal(1, errors);
81
+ Assert.Equal(2, errors);
82
Assert.Equal(expected, actual);
83
84
var script = File.ReadAllText("Foo.js");
src/test/WixToolsetTest.Converters/CustomTableFixture.cs
+1
-8
@@ -25,7 +25,6 @@ namespace WixToolsetTest.Converters
25
26
var expected = new[]
27
{
28
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
28
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
29
" <Fragment>",
30
" <CustomTable Id=\"Custom1\">",
@@ -64,7 +63,6 @@ namespace WixToolsetTest.Converters
63
64
var expected = new[]
65
{
67
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
66
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
67
" <Fragment>",
68
" <CustomTable Id=\"Custom1\">",
@@ -90,7 +88,6 @@ namespace WixToolsetTest.Converters
88
public void FixCustomRowCdataValue()
89
{
90
var parse = String.Join(Environment.NewLine,
93
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
91
"<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>",
92
" <Fragment>",
93
" <CustomTable Id='Custom1'>",
@@ -105,7 +102,6 @@ namespace WixToolsetTest.Converters
102
103
var expected = new[]
104
{
108
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
105
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
106
" <Fragment>",
107
" <CustomTable Id=\"Custom1\">",
@@ -121,7 +117,7 @@ namespace WixToolsetTest.Converters
117
var converter = new Wix3Converter(messaging, 2, null, null);
118
119
var errors = converter.ConvertDocument(document);
124
- Assert.Equal(3, errors);
120
+ Assert.Equal(2, errors);
121
122
var actualLines = UnformattedDocumentLines(document);
123
CompareLineByLine(expected, actualLines);
@@ -142,7 +138,6 @@ namespace WixToolsetTest.Converters
138
139
var expected = new[]
140
{
145
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
141
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
142
" <Fragment>",
143
" <CustomTable Id=\"Custom1\">",
@@ -168,13 +163,11 @@ namespace WixToolsetTest.Converters
163
public void CanConvertCustomTableBootstrapperApplicationData()
164
{
165
var parse = String.Join(Environment.NewLine,
171
- "<?xml version='1.0' encoding='utf-8'?>",
166
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
167
" <CustomTable Id='FgAppx' BootstrapperApplicationData='yes' />",
168
"</Wix>");
169
170
var expected = String.Join(Environment.NewLine,
177
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
171
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
172
" <CustomTable Id=\"FgAppx\" Unreal=\"yes\" />",
173
"</Wix>");
src/test/WixToolsetTest.Converters/PropertyFixture.cs
-6
@@ -14,7 +14,6 @@ namespace WixToolsetTest.Converters
14
public void CanFixCdataWhitespace()
15
{
16
var parse = String.Join(Environment.NewLine,
17
- "<?xml version='1.0' encoding='utf-8'?>",
17
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
18
" <Fragment>",
19
" <Property Id='Prop'>",
@@ -24,7 +23,6 @@ namespace WixToolsetTest.Converters
23
"</Wix>");
24
25
var expected = String.Join(Environment.NewLine,
27
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
26
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
27
" <Fragment>",
28
" <Property Id=\"Prop\" Value=\"1<2\" />",
@@ -48,7 +46,6 @@ namespace WixToolsetTest.Converters
46
public void CanFixCdataWithWhitespace()
47
{
48
var parse = String.Join(Environment.NewLine,
51
- "<?xml version='1.0' encoding='utf-8'?>",
49
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
50
" <Fragment>",
51
" <Property Id='Prop'>",
@@ -60,7 +57,6 @@ namespace WixToolsetTest.Converters
57
"</Wix>");
58
59
var expected = String.Join(Environment.NewLine,
63
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
60
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
61
" <Fragment>",
62
" <Property Id=\"Prop\" Value=\"1<2\" />",
@@ -84,7 +80,6 @@ namespace WixToolsetTest.Converters
80
public void CanKeepCdataWithOnlyWhitespace()
81
{
82
var parse = String.Join(Environment.NewLine,
87
- "<?xml version='1.0' encoding='utf-8'?>",
83
"<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>",
84
" <Fragment>",
85
" <Property Id='Prop'><![CDATA[ ]]></Property>",
@@ -92,7 +87,6 @@ namespace WixToolsetTest.Converters
87
"</Wix>");
88
89
var expected = String.Join(Environment.NewLine,
95
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
90
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
91
" <Fragment>",
92
" <Property Id=\"Prop\" Value=\" \" />",
src/test/WixToolsetTest.Converters/SequenceFixture.cs
+1
-3
@@ -14,7 +14,6 @@ namespace WixToolsetTest.Converters
14
public void FixCondition()
15
{
16
var parse = String.Join(Environment.NewLine,
17
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
17
"<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>",
18
" <Fragment>",
19
" <InstallUISequence>",
@@ -25,7 +24,6 @@ namespace WixToolsetTest.Converters
24
25
var expected = new[]
26
{
28
- "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
27
"<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
28
" <Fragment>",
29
" <InstallUISequence>",
@@ -41,7 +39,7 @@ namespace WixToolsetTest.Converters
39
var converter = new Wix3Converter(messaging, 2, null, null);
40
41
var errors = converter.ConvertDocument(document);
44
- Assert.Equal(3, errors);
42
+ Assert.Equal(2, errors);
43
44
var actualLines = UnformattedDocumentLines(document);
45
CompareLineByLine(expected, actualLines);
src/test/WixToolsetTest.Converters/TestData/PermissionEx/v3.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
2
<Fragment>
3
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
src/test/WixToolsetTest.Converters/TestData/PermissionEx/v4_expected.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
2
<Fragment>
3
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v3.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs
-1
@@ -1,4 +1,3 @@
1
-<?xml version="1.0" encoding="utf-8"?>
1
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3