-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathXmlWriterSettings.xml
1266 lines (1153 loc) · 79.3 KB
/
XmlWriterSettings.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="XmlWriterSettings" FullName="System.Xml.XmlWriterSettings">
<TypeSignature Language="C#" Value="public sealed class XmlWriterSettings" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit XmlWriterSettings extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Xml.XmlWriterSettings" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class XmlWriterSettings" />
<TypeSignature Language="F#" Value="type XmlWriterSettings = class" />
<TypeSignature Language="C++ CLI" Value="public ref class XmlWriterSettings sealed" />
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.Xml" FromVersion="4.0.0.0" To="System.Xml.ReaderWriter" ToVersion="0.0.0.0" FrameworkAlternate="dotnet-uwp-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Xml.ReaderWriter" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Xml.ReaderWriter" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Xml.ReaderWriter" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Xml.ReaderWriter" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Xml.ReaderWriter" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Specifies a set of features to support on the <see cref="T:System.Xml.XmlWriter" /> object created by the <see cref="Overload:System.Xml.XmlWriter.Create" /> method.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Xml.XmlWriter.Create%2A> method is the preferred mechanism for obtaining <xref:System.Xml.XmlWriter> instances. The <xref:System.Xml.XmlWriter.Create%2A> method uses the <xref:System.Xml.XmlWriterSettings> class to specify which features to implement in the <xref:System.Xml.XmlWriter> object that is created.
> [!NOTE]
> If you're using the <xref:System.Xml.XmlWriter> object with the <xref:System.Xml.Xsl.XslCompiledTransform.Transform%2A> method, you should use the <xref:System.Xml.Xsl.XslCompiledTransform.OutputSettings%2A> property to obtain an <xref:System.Xml.XmlWriterSettings> object with the correct settings. This ensures that the created <xref:System.Xml.XmlWriter> object has the correct output settings.
The <xref:System.Xml.XmlWriterSettings> class provides properties that control data conformance and output format.
For data conformance checks and auto-corrections, use these properties:
|Property|Specifies|Value|Default|
|--------------|---------------|-----------|-------------|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|Whether to check that characters are in the legal XML character set, as defined by W3C.|`true` or `false`|`true`|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|Whether to check that output is a well-formed XML 1.0 document or fragment.|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType> (document-level), <xref:System.Xml.ConformanceLevel.Fragment> (fragment-level), or <xref:System.Xml.ConformanceLevel.Auto> (auto-detection)|<xref:System.Xml.ConformanceLevel.Document?displayProperty=nameWithType> (document-level conformance)|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|Whether to add closing tags to all unclosed elements when the <xref:System.Xml.XmlWriter.Close%2A> method is called.|`true` or `false`|`true`|
To specify output format, use these properties:
|Property|Specifies|Value|Default|
|--------------|---------------|-----------|-------------|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|Text encoding to use.|<xref:System.Text.Encoding?displayProperty=nameWithType> value|<xref:System.Text.Encoding.UTF8?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|Whether to indent elements|`true` or `false`|`false` (no indentation)|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Character string to use when indenting (used when <xref:System.Xml.XmlWriterSettings.Indent%2A> is set to `true`).|String|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|Character string to use for line breaks.|String|`\r\n` (carriage return, line feed) for non-Unix platforms, or `\n` (line feed) for Unix platforms|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|How to handle newline characters.|<xref:System.Xml.NewLineHandling?displayProperty=nameWithType> value: <xref:System.Xml.NewLineHandling.Entitize> (normalize), <xref:System.Xml.NewLineHandling.Replace> (replace), or <xref:System.Xml.NewLineHandling.None> (leave unchanged)|<xref:System.Xml.NewLineHandling.Replace> (replace with characters specified by <xref:System.Xml.XmlWriterSettings.NewLineChars%2A>)|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|Whether to write attributes on individual lines (has no effect when <xref:System.Xml.XmlWriterSettings.Indent%2A> is `false`).|`true` or `false`|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|Whether to write an XML declaration.|`true` or `false`|`false`|
## Examples
The following example creates an <xref:System.Xml.XmlWriter> that writes to an XML file and writes each attribute on a new line.
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriterSettings/Overview/writenewlineattrs.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.NewLineOnAttributes/VB/writenewlineattrs.vb" id="Snippet1":::
The sample produces the following output:
```xml
<order
orderID="367A54"
date="2001-05-03">
<price>19.95</price>
</order>
```
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public XmlWriterSettings ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriterSettings.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 XmlWriterSettings();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Xml.XmlWriterSettings" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The following table shows initial property values for an instance of <xref:System.Xml.XmlWriterSettings>.
|Property|Initial Value|
|--------------|-------------------|
|<xref:System.Xml.XmlWriterSettings.Async%2A>|`false`.|
|<xref:System.Xml.XmlWriterSettings.CheckCharacters%2A>|`true`.|
|<xref:System.Xml.XmlWriterSettings.CloseOutput%2A>|`false`.|
|<xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A>|<xref:System.Xml.ConformanceLevel.Document>.|
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|`Encoding.UTF8`.|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`.|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces.|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, line feed) for non-Unix platforms, or `\n` (line feed) for Unix platforms.|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|<xref:System.Xml.NewLineHandling.Replace>.|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`.|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`.|
|<xref:System.Xml.XmlWriterSettings.WriteEndDocumentOnClose%2A>|`true`.|
## Examples
The following example creates an <xref:System.Xml.XmlWriter> object that uses the TAB character for indentation.
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriter/Create/writeindent.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.Indent/VB/writeindent.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Async">
<MemberSignature Language="C#" Value="public bool Async { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Async" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.Async" />
<MemberSignature Language="VB.NET" Value="Public Property Async As Boolean" />
<MemberSignature Language="F#" Value="member this.Async : bool with get, set" Usage="System.Xml.XmlWriterSettings.Async" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool Async { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether asynchronous <see cref="T:System.Xml.XmlWriter" /> methods can be used on a particular <see cref="T:System.Xml.XmlWriter" /> instance.</summary>
<value>
<see langword="true" /> if asynchronous methods can be used; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You must set this value to `true` when you create a new <xref:System.Xml.XmlWriter> instance if you want to use asynchronous <xref:System.Xml.XmlWriter> methods on that instance. After the <xref:System.Xml.XmlWriter> instance is created, the <xref:System.Xml.XmlWriterSettings.Async%2A> property is read-only. The default value of this property is `false`.
This flag is ignored by the <xref:System.Xml.XmlWriter.Create%2A?displayProperty=nameWithType> overload. This means that if you create a new <xref:System.Xml.XmlWriter> based on an existing <xref:System.Xml.XmlWriter>, the async behavior depends on the input <xref:System.Xml.XmlWriter>, and you cannot use the <xref:System.Xml.XmlWriterSettings.Async%2A> flag to change the async behavior.
]]></format>
</remarks>
<related type="Article" href="/dotnet/csharp/async">Asynchronous programming (C#)</related>
<related type="Article" href="/dotnet/visual-basic/programming-guide/concepts/async/">Asynchronous programming with Async and Await (Visual Basic)</related>
</Docs>
</Member>
<Member MemberName="CheckCharacters">
<MemberSignature Language="C#" Value="public bool CheckCharacters { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CheckCharacters" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.CheckCharacters" />
<MemberSignature Language="VB.NET" Value="Public Property CheckCharacters As Boolean" />
<MemberSignature Language="F#" Value="member this.CheckCharacters : bool with get, set" Usage="System.Xml.XmlWriterSettings.CheckCharacters" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool CheckCharacters { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the XML writer should check to ensure that all characters in the document conform to the "2.2 Characters" section of the W3C <see href="https://www.w3.org/TR/REC-xml/#charsets">XML 1.0 Recommendation</see>.</summary>
<value>
<see langword="true" /> to do character checking; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Xml.XmlWriter> object supports character checking, it throws an exception if any characters are outside the range of legal XML characters specified by the "2.2 Characters" section of the W3C [XML 1.0 Recommendation](https://www.w3.org/TR/REC-xml/#charsets).
Character checking does not include checking for illegal characters in XML names or checking that all XML names are valid. These checks are part of conformance checking and are always performed.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Clone">
<MemberSignature Language="C#" Value="public System.Xml.XmlWriterSettings Clone ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Xml.XmlWriterSettings Clone() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.XmlWriterSettings.Clone" />
<MemberSignature Language="VB.NET" Value="Public Function Clone () As XmlWriterSettings" />
<MemberSignature Language="F#" Value="member this.Clone : unit -> System.Xml.XmlWriterSettings" Usage="xmlWriterSettings.Clone " />
<MemberSignature Language="C++ CLI" Value="public:
 System::Xml::XmlWriterSettings ^ Clone();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlWriterSettings</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a copy of the <see cref="T:System.Xml.XmlWriterSettings" /> instance.</summary>
<returns>The cloned <see cref="T:System.Xml.XmlWriterSettings" /> object.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The cloned <xref:System.Xml.XmlWriterSettings> object can be modified without affecting the settings on the original object.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CloseOutput">
<MemberSignature Language="C#" Value="public bool CloseOutput { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CloseOutput" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.CloseOutput" />
<MemberSignature Language="VB.NET" Value="Public Property CloseOutput As Boolean" />
<MemberSignature Language="F#" Value="member this.CloseOutput : bool with get, set" Usage="System.Xml.XmlWriterSettings.CloseOutput" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool CloseOutput { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the <see cref="T:System.Xml.XmlWriter" /> should also close the underlying stream or <see cref="T:System.IO.TextWriter" /> when the <see cref="M:System.Xml.XmlWriter.Close" /> method is called.</summary>
<value>
<see langword="true" /> to also close the underlying stream or <see cref="T:System.IO.TextWriter" />; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This setting is useful when you wish to write XML to a stream, and then add extra information to the end of the stream after the <xref:System.Xml.XmlWriter> has finished writing.
This property only applies to <xref:System.Xml.XmlWriter> instances that output XML content to a stream or <xref:System.IO.TextWriter>; otherwise, this setting is ignored.
## Examples
The following example writes an XML fragment to a memory stream.
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriter/Create/writestream2.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.CloseOutput/VB/writestream2.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ConformanceLevel">
<MemberSignature Language="C#" Value="public System.Xml.ConformanceLevel ConformanceLevel { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Xml.ConformanceLevel ConformanceLevel" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.ConformanceLevel" />
<MemberSignature Language="VB.NET" Value="Public Property ConformanceLevel As ConformanceLevel" />
<MemberSignature Language="F#" Value="member this.ConformanceLevel : System.Xml.ConformanceLevel with get, set" Usage="System.Xml.XmlWriterSettings.ConformanceLevel" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Xml::ConformanceLevel ConformanceLevel { System::Xml::ConformanceLevel get(); void set(System::Xml::ConformanceLevel value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.ConformanceLevel</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the level of conformance that the XML writer checks the XML output for.</summary>
<value>One of the enumeration values that specifies the level of conformance (document, fragment, or automatic detection). The default is <see cref="F:System.Xml.ConformanceLevel.Document" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Xml.XmlWriterSettings.ConformanceLevel%2A?displayProperty=nameWithType> property configures the XML writer to check and guarantee that the stream being written complies with a certain set of rules. The XML data can be checked to see that it conforms to the rules for a well-formed XML 1.0 document or a document fragment. The following table describes the three settings. The default is document-level conformance.
|Setting|Description|
|-------------|-----------------|
|<xref:System.Xml.ConformanceLevel.Document>|Ensures that the XML output conforms to the [rules for a well-formed XML 1.0 document](https://www.w3.org/TR/REC-xml/#sec-well-formed) and can be processed by any conforming processor.<br /><br /> The document conformance checks include most of the fragment-level checks and also ensure the following:<br /><br /> - The top-level item doesn't have any nodes other than XML Declaration, DTD, element, comment, white space, or processing instruction.<br />- The XML data has one and only one top-level element node.<br /><br /> The XML writer doesn't parse DTD information that is written. The user is responsible for ensuring that the DTD is well-formed.|
|<xref:System.Xml.ConformanceLevel.Fragment>|Ensures that the XML output conforms to the [rules for a well-formed XML 1.0 document fragment](https://www.w3.org/TR/REC-xml/#wf-entities).<br /><br /> This setting accepts XML data that has multiple root elements or text nodes at the top level. This level of checking ensures that any processor can consume the stream being read as an XML 1.0 external parsed entity.<br /><br /> DTD information isn't allowed in document fragments.|
|<xref:System.Xml.ConformanceLevel.Auto>|Specifies that the XML writer should determine the level of conformance checking based on the incoming data. This setting can be useful when you don't know whether the generated XML will be a well-formed XML document or a fragment.<br /><br /> Document conformance checking is applied in the following cases:<br /><br /> - If the <xref:System.Xml.XmlWriter.WriteStartDocument%2A> method is called.<br />- If DTD information is written.<br /><br /> Fragment conformance checking is applied if the XML data contains one of these:<br /><br /> - Text, CDATA, or EntityReference node at the root level.<br />- More than one element at the root level.<br />- No element at the root level.<br /><br /> An <xref:System.Xml.XmlException> is thrown if there is a conflict, such as when you try to write a text node and a DTD at the root level.<br /><br /> If you are wrapping another <xref:System.Xml.XmlWriter> object, the outer object doesn't do any additional conformance checking; this is left to the underlying object.|
If the XML writer detects any information that would violate the specified level of conformance, it throws an exception. In some cases, the XML writer automatically corrects the conformance error. For example, the writer closes an unclosed attribute without throwing an exception. The following table shows how various conformance violations are handled in each setting.
|Condition|<xref:System.Xml.ConformanceLevel.Document>|<xref:System.Xml.ConformanceLevel.Fragment>|<xref:System.Xml.ConformanceLevel.Auto>|
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
|DTD information is found.|Not a violation for this setting. However, the XML writer doesn't check the DTD; the user must ensure that the DTD is well-formed.|<xref:System.Xml.XmlException> is thrown.|Document conformance checking is applied.|
|<xref:System.Xml.XmlWriter.WriteStartDocument%2A> is called.|Not considered a violation for this setting.|<xref:System.Xml.XmlException> is thrown.|Document conformance checking is applied.|
|<xref:System.Xml.XmlWriter.WriteStartDocument%2A> is called multiple times.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|A text value appears at the top level (not below an element or attribute node).|<xref:System.Xml.XmlException> is thrown.|Not considered a violation.|Fragment conformance checking is applied.|
|Multiple elements or no elements appear at the top level.|<xref:System.Xml.XmlException> is thrown.|Not considered a violation.|Fragment conformance checking is applied.|
|Top-level item is white space.|Not considered a violation.|Not considered a violation.|Not considered a violation.|
|<xref:System.Xml.XmlWriter.WriteEndAttribute%2A> isn't called to end an attribute node.|Fixed by XML writer.|Fixed by XML writer.|Fixed by XML writer.|
|The XML writer is in an improperly nested state (for example, a <xref:System.Xml.XmlWriter.WriteStartElement%2A> call is followed by a <xref:System.Xml.XmlWriter.WriteEndAttribute%2A>).|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|Top-level item is an attribute.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|Multiple, contiguous text nodes are found.|Not considered a violation, but it's the responsibility of the user to concatenate the text nodes.|Not considered a violation, but it's the responsibility of the user to concatenate the text nodes.|Not considered a violation, but it's the responsibility of the user to concatenate the text nodes.|
|The same namespace prefix is declared twice in an element.|The XML writer generates a new prefix for the second namespace.|The XML writer generates a new prefix for the second namespace.|The XML writer generates a new prefix for the second namespace.|
|<xref:System.Xml.XmlWriter.WriteStartElement%2A> specifies a prefix and a namespace that isn't declared within that scope, or the prefix is associated with a different namespace.|The XML writer writes the necessary namespace node.|The XML writer writes the necessary namespace node.|The XML writer writes the necessary namespace node.|
|<xref:System.Xml.XmlWriter.WriteStartAttribute%2A> specifies a prefix and a namespace that isn't declared within that scope.|The XML writer writes the necessary namespace node.|The XML writer writes the necessary namespace node.|The XML writer writes the necessary namespace node.|
|<xref:System.Xml.XmlWriter.WriteStartAttribute%2A> specifies a prefix and a namespace, but the prefix is associated with a different in-scope namespace.|The XML writer ignores the specified prefix and either looks up the correct prefix or generates a new prefix.|The XML writer ignores the specified prefix and either looks up the correct prefix or generates a new prefix.|The XML writer ignores the specified prefix and either looks up the correct prefix or generates a new prefix.|
|<xref:System.Xml.XmlWriter.WriteQualifiedName%2A> is used to write element content by using a namespace that doesn't exist within the scope.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|<xref:System.Xml.XmlWriter.WriteQualifiedName%2A> is used to write attribute content by using a namespace that doesn't exist within the scope.|The XML writer writes the necessary namespace declaration.|The XML writer writes the necessary namespace declaration.|The XML writer writes the necessary namespace declaration.|
|The `xml:space` attribute doesn't contain a valid value.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|An invalid name is encountered.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|The `xml` prefix isn't matched to a URI.|The XML writer doesn't check for this type of violation.|The XML writer doesn't check for this type of violation.|The XML writer doesn't check for this type of violation.|
|The `xml` prefix isn't matched to the http://www.w3.org/XML/1998/namespace URI.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
|The `xmlns` prefix or local name isn't matched to a URI.|The XML writer doesn't check for this type of violation.|The XML writer doesn't check for this type of violation.|The XML writer doesn't check for this type of violation.|
|The `xmlns` prefix or local name isn't matched to the http://www.w3.org/2000/xmlns URI.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|<xref:System.Xml.XmlException> is thrown.|
## Examples
The following example writes an XML fragment to a memory stream.
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriter/Create/writestream2.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.CloseOutput/VB/writestream2.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DoNotEscapeUriAttributes">
<MemberSignature Language="C#" Value="public bool DoNotEscapeUriAttributes { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool DoNotEscapeUriAttributes" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.DoNotEscapeUriAttributes" />
<MemberSignature Language="VB.NET" Value="Public Property DoNotEscapeUriAttributes As Boolean" />
<MemberSignature Language="F#" Value="member this.DoNotEscapeUriAttributes : bool with get, set" Usage="System.Xml.XmlWriterSettings.DoNotEscapeUriAttributes" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool DoNotEscapeUriAttributes { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the <see cref="T:System.Xml.XmlWriter" /> does not escape URI attributes.</summary>
<value>
<see langword="true" /> if the <see cref="T:System.Xml.XmlWriter" /> does not escape URI attributes; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Encoding">
<MemberSignature Language="C#" Value="public System.Text.Encoding Encoding { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Text.Encoding Encoding" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.Encoding" />
<MemberSignature Language="VB.NET" Value="Public Property Encoding As Encoding" />
<MemberSignature Language="F#" Value="member this.Encoding : System.Text.Encoding with get, set" Usage="System.Xml.XmlWriterSettings.Encoding" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Text::Encoding ^ Encoding { System::Text::Encoding ^ get(); void set(System::Text::Encoding ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Text.Encoding</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the type of text encoding to use.</summary>
<value>The text encoding to use. The default is <see langword="Encoding.UTF8" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Xml.XmlWriter> encodes a buffer of characters all at once, rather than character by character. An exception is thrown when the <xref:System.Xml.XmlWriter.Flush%2A> method is called if any encoding errors are encountered.
The <xref:System.Xml.XmlWriterSettings.Encoding%2A> property only applies to the <xref:System.Xml.XmlWriter> instances that are created either with the specified <xref:System.IO.Stream> or with the specified file name. If the <xref:System.Xml.XmlWriter> instance is created with the specified <xref:System.IO.TextWriter>, the <xref:System.Xml.XmlWriterSettings.Encoding%2A> property is overridden by the encoding of the underlying <xref:System.IO.TextWriter>. For example, if this property is set to Unicode (UTF-16) for a particular <xref:System.Xml.XmlWriter>, but the underlying writer is a <xref:System.IO.StreamWriter> (which derives from <xref:System.IO.TextWriter>) with its encoding set to UTF8, the output will be UTF-8 encoded.
If the <xref:System.Xml.XmlWriter> instance is created with other output parameters, the <xref:System.Xml.XmlWriterSettings.Encoding%2A> property is ignored.
In the following example:
- The default value of <xref:System.Xml.XmlWriterSettings.Encoding%2A> is `Encoding.UTF8`.
- The <xref:System.IO.StreamWriter> is set to `Encoding.Unicode` and the <xref:System.IO.StreamWriter>'s encoding overrides the <xref:System.Xml.XmlWriterSettings.Encoding%2A> setting.
- The output will be `Encoding.Unicode`.
```csharp
using (StreamWriter output =
new StreamWriter(new FileStream("Xml01.xml", FileMode.Create), Encoding.Unicode))
{
using (XmlWriter xmlWriter =
XmlWriter.Create(output, new XmlWriterSettings()))
{
xmlWriter.WriteStartDocument();
xmlWriter.WriteStartElement("Root");
xmlWriter.WriteEndElement();
xmlWriter.WriteEndDocument();
}
}
```
> [!IMPORTANT]
> Do not accept an <xref:System.Text.Encoding> object from an untrusted source.
## Examples
The following example shows how to set the `Encoding` property:
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriterSettings/Encoding/migration.cs" id="Snippet6":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XML_Migration/VB/migration.vb" id="Snippet6":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Indent">
<MemberSignature Language="C#" Value="public bool Indent { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Indent" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.Indent" />
<MemberSignature Language="VB.NET" Value="Public Property Indent As Boolean" />
<MemberSignature Language="F#" Value="member this.Indent : bool with get, set" Usage="System.Xml.XmlWriterSettings.Indent" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool Indent { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether to indent elements.</summary>
<value>
<see langword="true" /> to write individual elements on new lines and indent; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property only applies to <xref:System.Xml.XmlWriter> instances that output text content; otherwise, this setting is ignored.
The elements are indented as long as the element does not contain mixed content. Once the <xref:System.Xml.XmlWriter.WriteString%2A> or <xref:System.Xml.XmlWriter.WriteWhitespace%2A> method is called to write out a mixed element content, the <xref:System.Xml.XmlWriter> stops indenting. The indenting resumes once the mixed content element is closed.
## Examples
The following example creates an <xref:System.Xml.XmlWriter> object that uses the TAB character for indentation.
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriter/Create/writeindent.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.Indent/VB/writeindent.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IndentChars">
<MemberSignature Language="C#" Value="public string IndentChars { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string IndentChars" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.IndentChars" />
<MemberSignature Language="VB.NET" Value="Public Property IndentChars As String" />
<MemberSignature Language="F#" Value="member this.IndentChars : string with get, set" Usage="System.Xml.XmlWriterSettings.IndentChars" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ IndentChars { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the character string to use when indenting. This setting is used when the <see cref="P:System.Xml.XmlWriterSettings.Indent" /> property is set to <see langword="true" />.</summary>
<value>The character string to use when indenting. This can be set to any string value. However, to ensure valid XML, you should specify only valid white space characters, such as space characters, tabs, carriage returns, or line feeds. The default is two spaces.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property only applies to <xref:System.Xml.XmlWriter> instances that output text content; otherwise, this setting is ignored. The <xref:System.Xml.XmlWriter> throws an exception if the indent characters would result in invalid XML.
## Examples
The following example creates an <xref:System.Xml.XmlWriter> object that uses the TAB character for indentation.
:::code language="csharp" source="~/snippets/csharp/System.Xml/XmlWriter/Create/writeindent.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Data/XmlWriterSettings.Indent/VB/writeindent.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The value assigned to the <see cref="P:System.Xml.XmlWriterSettings.IndentChars" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="NamespaceHandling">
<MemberSignature Language="C#" Value="public System.Xml.NamespaceHandling NamespaceHandling { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Xml.NamespaceHandling NamespaceHandling" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.NamespaceHandling" />
<MemberSignature Language="VB.NET" Value="Public Property NamespaceHandling As NamespaceHandling" />
<MemberSignature Language="F#" Value="member this.NamespaceHandling : System.Xml.NamespaceHandling with get, set" Usage="System.Xml.XmlWriterSettings.NamespaceHandling" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Xml::NamespaceHandling NamespaceHandling { System::Xml::NamespaceHandling get(); void set(System::Xml::NamespaceHandling value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.NamespaceHandling</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the <see cref="T:System.Xml.XmlWriter" /> should remove duplicate namespace declarations when writing XML content. The default behavior is for the writer to output all namespace declarations that are present in the writer's namespace resolver.</summary>
<value>The <see cref="T:System.Xml.NamespaceHandling" /> enumeration used to specify whether to remove duplicate namespace declarations in the <see cref="T:System.Xml.XmlWriter" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="NewLineChars">
<MemberSignature Language="C#" Value="public string NewLineChars { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string NewLineChars" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.NewLineChars" />
<MemberSignature Language="VB.NET" Value="Public Property NewLineChars As String" />
<MemberSignature Language="F#" Value="member this.NewLineChars : string with get, set" Usage="System.Xml.XmlWriterSettings.NewLineChars" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ NewLineChars { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the character string to use for line breaks.</summary>
<value>The character string to use for line breaks. This can be set to any string value. However, to ensure valid XML, you should specify only valid white space characters, such as space characters, tabs, carriage returns, or line feeds. The default is <c>\r\n</c> (carriage return, new line) for non-Unix platforms, and <c>\n</c> (new line) for Unix platforms.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property only applies to <xref:System.Xml.XmlWriter> instances that output text content; otherwise, this setting is ignored. The <xref:System.Xml.XmlWriter> throws an exception if the line break characters would result in invalid XML.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The value assigned to the <see cref="P:System.Xml.XmlWriterSettings.NewLineChars" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="NewLineHandling">
<MemberSignature Language="C#" Value="public System.Xml.NewLineHandling NewLineHandling { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Xml.NewLineHandling NewLineHandling" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.NewLineHandling" />
<MemberSignature Language="VB.NET" Value="Public Property NewLineHandling As NewLineHandling" />
<MemberSignature Language="F#" Value="member this.NewLineHandling : System.Xml.NewLineHandling with get, set" Usage="System.Xml.XmlWriterSettings.NewLineHandling" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Xml::NewLineHandling NewLineHandling { System::Xml::NewLineHandling get(); void set(System::Xml::NewLineHandling value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Xml.NewLineHandling</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether to normalize line breaks in the output.</summary>
<value>One of the <see cref="T:System.Xml.NewLineHandling" /> values. The default is <see cref="F:System.Xml.NewLineHandling.Replace" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This setting applies when writing text content or attribute values. Each of the <xref:System.Xml.NewLineHandling> values is described below:
- The <xref:System.Xml.NewLineHandling.Entitize> setting tells the <xref:System.Xml.XmlWriter> to replace new line characters that would not be otherwise preserved by a normalizing <xref:System.Xml.XmlReader> with character entities. This is useful in round-trip scenarios where the output is read by a normalizing <xref:System.Xml.XmlReader>. Additional normalization rules apply for attribute values when round tripping since `\t`, `\n` and `\r` are replaced with a space in attribute values when normalized in an <xref:System.Xml.XmlReader>.
- The <xref:System.Xml.NewLineHandling.Replace> setting tells the <xref:System.Xml.XmlWriter> to replace new line characters with the character(s) specificed in the <xref:System.Xml.XmlWriterSettings.NewLineChars%2A> property. This setting also replaces new lines in attributes with character entities to preserve the characters. It is also the default value.
- The <xref:System.Xml.NewLineHandling.None> setting tells the <xref:System.Xml.XmlWriter> to leave the input unchanged. This setting is used when you do not want any new-line processing. This is useful when the output is read by an <xref:System.Xml.XmlReader> that does not do any normalization (for example, an <xref:System.Xml.XmlTextReader> with default settings.)
The following tables show the output of the <xref:System.Xml.XmlWriter.WriteString%2A> method when supplied with the input value depending on the <xref:System.Xml.XmlWriterSettings.NewLineHandling%2A> property setting. The tables show the output when writing text content and also when writing an attribute value.
Text Node Value:
| `NewLineHandling` | \r\n | \n | \r | \t |
|-------------------|--------|------|------|----|
| `Entitize` | &#D;\n | \n | &#D; | \t |
| `Replace` | \r\n | \r\n | \r\n | \t |
| `None` | \r\n | \n | \r | \t |
Attribute Value:
| `NewLineHandling` | \r\n | \n | \r | \t |
|-------------------|----------|------|------|-------|
| `Entitize` | &#D;&#A; | &#A; | &#D; | &\#9; |
| `Replace` | &#D;&#A; | &#A; | &#D; | &\#9; |
| `None` | \r\n | \n | \r | \t |
> [!NOTE]
> The <xref:System.Xml.XmlWriter> has the following behavior when writing content within a CDATA section, comment, or processing instruction. New lines are never replaced with their character entities, even when the <xref:System.Xml.XmlWriterSettings.NewLineHandling%2A> property is set to <xref:System.Xml.NewLineHandling.Entitize>. This is because character entities are not recognized in CDATA sections, comments or processing instructions. If the <xref:System.Xml.XmlWriterSettings.NewLineHandling%2A> property is set to <xref:System.Xml.NewLineHandling.None> or <xref:System.Xml.NewLineHandling.Replace>, the behavior is the same as when writing a text node value.
The following table describes what a normalizing <xref:System.Xml.XmlReader> returns for each white space input. For more information, see sections 2.11 and 3.3.3 of the W3C [XML 1.0 Recommendation](https://www.w3.org/TR/REC-xml/).
| Value type | \r\n | \n | \r | \t |
|------------|--------------|--------------|--------------|--------------|
| Text Node | \n | \n | \n | \t |
| Attribute | single space | single space | single space | single space |
> [!NOTE]
> A normalizing reader is any <xref:System.Xml.XmlReader> object created by the <xref:System.Xml.XmlReader.Create%2A?displayProperty=nameWithType> method. These objects always perform line break normalization and full normalization of attributes. The <xref:System.Xml.XmlTextReader> object can also be a normalizing reader if its <xref:System.Xml.XmlTextReader.Normalization%2A> property is set to `true`.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="NewLineOnAttributes">
<MemberSignature Language="C#" Value="public bool NewLineOnAttributes { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool NewLineOnAttributes" />
<MemberSignature Language="DocId" Value="P:System.Xml.XmlWriterSettings.NewLineOnAttributes" />
<MemberSignature Language="VB.NET" Value="Public Property NewLineOnAttributes As Boolean" />
<MemberSignature Language="F#" Value="member this.NewLineOnAttributes : bool with get, set" Usage="System.Xml.XmlWriterSettings.NewLineOnAttributes" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool NewLineOnAttributes { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml.ReaderWriter</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether to write attributes on a new line.</summary>
<value>
<see langword="true" /> to write attributes on individual lines; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property only applies to <xref:System.Xml.XmlWriter> instances that output text content; otherwise, this setting is ignored.