XmlWriter::Create Method (String^, XmlWriterSettings^)

 

Creates a new XmlWriter instance using the filename and XmlWriterSettings object.

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

public:
static XmlWriter^ Create(
	String^ outputFileName,
	XmlWriterSettings^ settings
)

Parameters

outputFileName
Type: System::String^

The file to which you want to write. The XmlWriter creates a file at the specified path and writes to it in XML 1.0 text syntax. The outputFileName must be a file system path.

settings
Type: System.Xml::XmlWriterSettings^

The XmlWriterSettings object used to configure the new XmlWriter instance. If this is null, a XmlWriterSettings with default settings is used.

If the XmlWriter is being used with the Transform method, you should use the OutputSettings property to obtain an XmlWriterSettings object with the correct settings. This ensures that the created XmlWriter object has the correct output settings.

Return Value

Type: System.Xml::XmlWriter^

An XmlWriter object.

Exception Condition
ArgumentNullException

The url value is null.

The following example creates an XmlWriter object with the defined settings.

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

.NET Framework
Available since 2.0
Return to top
Show: