Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XmlWriterSettings::NewLineOnAttributes Property

 

Gets or sets a value indicating whether to write attributes on a new line.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public:
property bool NewLineOnAttributes {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true to write attributes on individual lines; otherwise, false. The default is false.

System_CAPS_noteNote

This setting has no effect when the Indent property value is false.

When NewLineOnAttributes is set to true, each attribute is pre-pended with a new line and one extra level of indentation.

This property only applies to XmlWriter instances that output text content; otherwise, this setting is ignored.

The following example creates an XmlWriter that writes to an XML file and writes each attribute on a new line.

No code example is currently available or this language may not be supported.

The sample produces the following output:

<order
  orderID="367A54"
  date="2001-05-03">
  <price>19.95</price>
</order>

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft