XDeclaration Class

XDeclaration Class

 

Represents an XML declaration.

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

System.Object
  System.Xml.Linq.XDeclaration

type XDeclaration = class end

NameDescription
System_CAPS_pubmethodXDeclaration(String, String, String)

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

System_CAPS_pubmethodXDeclaration(XDeclaration)

Initializes a new instance of the XDeclaration class from another XDeclaration object.

NameDescription
System_CAPS_pubpropertyEncoding

Gets or sets the encoding for this document.

System_CAPS_pubpropertyStandalone

Gets or sets the standalone property for this document.

System_CAPS_pubpropertyVersion

Gets or sets the version property for this document.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Provides the declaration as a formatted string.(Overrides Object.ToString().)

An XML declaration is used to declare the XML version, the encoding, and whether or not the XML document is standalone. This class represents the XML concept of an XML declaration.

Just as in the XML standard, declarations are associated with a document. When you create a document, you have the option to specify the declaration for the document. The XDocument class contains the Declaration property, which allows you to set or get the declaration. For information about how to serialize an XML tree with an XML declaration, see Serializing with an XML Declaration.

Universal Windows Platform
Available since 4.5
.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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft