Export (0) Print
Expand All

XDeclaration Class

Represents an XML declaration.

System.Object
  System.Xml.Linq.XDeclaration

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

public class XDeclaration

The XDeclaration type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryXDeclaration(XDeclaration)Initializes a new instance of the XDeclaration class from another XDeclaration object.
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryXDeclaration(String, String, String)Initializes a new instance of the XDeclaration class with the specified version, encoding, and standalone status.
Top

  NameDescription
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryEncodingGets or sets the encoding for this document.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryStandaloneGets or sets the standalone property for this document.
Public propertySupported by the XNA FrameworkSupported by Portable Class LibraryVersionGets or sets the version property for this document.
Top

  NameDescription
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by the XNA FrameworkSupported by Portable Class LibraryToStringProvides the declaration as a formatted string. (Overrides Object.ToString().)
Top

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

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