XDeclaration Constructor (String^, String^, String^)

 

Initializes a new instance of the XDeclaration class with the specified version, encoding, and standalone status.

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

public:
XDeclaration(
	String^ version,
	String^ encoding,
	String^ standalone
)

Parameters

version
Type: System::String^

The version of the XML, usually "1.0".

encoding
Type: System::String^

The encoding for the XML document.

standalone
Type: System::String^

A string containing "yes" or "no" that specifies whether the XML is standalone or requires external entities to be resolved.

The following example creates a document that contains a declaration.

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

This example produces the following output:


                <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--This is a comment-->
<Root>content</Root>

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
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: