Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Document correct NewLineChars default values
Fixes #8315
  • Loading branch information
wenz committed Oct 27, 2022
commit 1b4c34d3dbf88dde48faaae727fe7db1df76486b
14 changes: 7 additions & 7 deletions xml/System.Xml/XmlWriter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
|<xref:System.Xml.XmlWriterSettings.Encoding%2A>|Specifies the text encoding to use. The default is `Encoding.UTF8`.|
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|Indicates whether to indent elements. The default is `false` (no indentation).|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Specifies the character string to use when indenting. The default is two spaces.|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|Specifies the character string to use for line breaks. The default is `\r\n` (carriage return, line feed).|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|Specifies the character string to use for line breaks. The default is `\r\n` (carriage return, line feed) for non-Unix platforms, and `\n` (line feed) for Unix platforms.|
|<xref:System.Xml.XmlWriterSettings.NewLineHandling%2A>|Specifies how to handle newline characters.|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|Indicates whether to write attributes on a new line. <xref:System.Xml.XmlWriterSettings.Indent%2A> should be set to `true` when using this property. The default is `false`.|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|Indicates whether to write an XML declaration. The default is `false`.|
Expand Down Expand Up @@ -378,7 +378,7 @@ An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asy
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<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?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
Expand Down Expand Up @@ -454,7 +454,7 @@ An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asy
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<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?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
Expand Down Expand Up @@ -540,7 +540,7 @@ An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asy
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<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?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
Expand Down Expand Up @@ -621,7 +621,7 @@ An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asy
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<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?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
Expand Down Expand Up @@ -705,7 +705,7 @@ An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asy
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<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?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
Expand Down Expand Up @@ -783,7 +783,7 @@ An <see cref="T:System.Xml.XmlWriter" /> method was called before a previous asy
|<xref:System.Xml.XmlWriterSettings.Indent%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.IndentChars%2A>|Two spaces|
|<xref:System.Xml.XmlWriterSettings.NamespaceHandling%2A>|<xref:System.Xml.NamespaceHandling.Default> (no removal)|
|<xref:System.Xml.XmlWriterSettings.NewLineChars%2A>|`\r\n` (carriage return, new line)|
|<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?displayProperty=nameWithType>|
|<xref:System.Xml.XmlWriterSettings.NewLineOnAttributes%2A>|`false`|
|<xref:System.Xml.XmlWriterSettings.OmitXmlDeclaration%2A>|`false`|
Expand Down
10 changes: 5 additions & 5 deletions xml/System.Xml/XmlWriterSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
|<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)|
|<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`|
Expand Down Expand Up @@ -141,7 +141,7 @@
|<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, new line).|
|<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`.|
Expand Down Expand Up @@ -808,7 +808,7 @@ using (StreamWriter output =
</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).</value>
<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[

Expand Down Expand Up @@ -871,7 +871,7 @@ using (StreamWriter output =

- 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 `\r\n`, which is the new line format used by the Microsoft Windows operating system. This helps to ensure that the file can be correctly displayed by the Notepad or Microsoft Word applications. This setting also replaces new lines in attributes with character entities to preserve the characters. This is the default value.
- 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.

- 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.)

Expand Down Expand Up @@ -1159,7 +1159,7 @@ This setting has no effect when the <xref:System.Xml.XmlWriterSettings.Indent> p
|<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`.|
|<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`.|
Expand Down