1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="XDeclaration" FullName="System.Xml.Linq.XDeclaration">
3 <TypeSignature Language="C#" Value="public class XDeclaration" />
4 <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit XDeclaration extends System.Object" />
6 <AssemblyName>System.Xml.Linq</AssemblyName>
7 <AssemblyVersion>4.0.0.0</AssemblyVersion>
10 <BaseTypeName>System.Object</BaseTypeName>
15 <attribution license="cc4" from="Microsoft" modified="false" />
16 <para>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. </para>
17 <para>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 <see cref="T:System.Xml.Linq.XDocument" /> class contains the <see cref="P:System.Xml.Linq.XDocument.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 <format type="text/html"><a href="30f1b564-62b5-4e5d-9c36-884e51113feb">Saving With an XML Declaration</a></format>. </para>
20 <attribution license="cc4" from="Microsoft" modified="false" />
21 <para>Represents an XML declaration.</para>
25 <Member MemberName=".ctor">
26 <MemberSignature Language="C#" Value="public XDeclaration (System.Xml.Linq.XDeclaration other);" />
27 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Xml.Linq.XDeclaration other) cil managed" />
28 <MemberType>Constructor</MemberType>
30 <AssemblyVersion>4.0.0.0</AssemblyVersion>
33 <Parameter Name="other" Type="System.Xml.Linq.XDeclaration" />
37 <attribution license="cc4" from="Microsoft" modified="false" />
38 <para>This constructor is primarily used internally to make a deep copy of an XML tree.</para>
41 <attribution license="cc4" from="Microsoft" modified="false" />
42 <para>Initializes a new instance of the <see cref="T:System.Xml.Linq.XDeclaration" /> class from another <see cref="T:System.Xml.Linq.XDeclaration" /> object. </para>
45 <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Xml.Linq.XDeclaration" /> used to initialize this <see cref="T:System.Xml.Linq.XDeclaration" /> object.</param>
48 <Member MemberName=".ctor">
49 <MemberSignature Language="C#" Value="public XDeclaration (string version, string encoding, string standalone);" />
50 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string version, string encoding, string standalone) cil managed" />
51 <MemberType>Constructor</MemberType>
53 <AssemblyVersion>4.0.0.0</AssemblyVersion>
56 <Parameter Name="version" Type="System.String" />
57 <Parameter Name="encoding" Type="System.String" />
58 <Parameter Name="standalone" Type="System.String" />
61 <remarks>To be added.</remarks>
63 <attribution license="cc4" from="Microsoft" modified="false" />
64 <para>Initializes a new instance of the <see cref="T:System.Xml.Linq.XDeclaration" /> class with the specified version, encoding, and standalone status.</para>
66 <param name="version">
67 <attribution license="cc4" from="Microsoft" modified="false" />The version of the XML, usually "1.0".</param>
68 <param name="encoding">
69 <attribution license="cc4" from="Microsoft" modified="false" />The encoding for the XML document.</param>
70 <param name="standalone">
71 <attribution license="cc4" from="Microsoft" modified="false" />A string containing "yes" or "no" that specifies whether the XML is standalone or requires external entities to be resolved.</param>
74 <Member MemberName="Encoding">
75 <MemberSignature Language="C#" Value="public string Encoding { get; set; }" />
76 <MemberSignature Language="ILAsm" Value=".property instance string Encoding" />
77 <MemberType>Property</MemberType>
79 <AssemblyVersion>4.0.0.0</AssemblyVersion>
82 <ReturnType>System.String</ReturnType>
85 <value>To be added.</value>
87 <attribution license="cc4" from="Microsoft" modified="false" />
88 <para>Any value returned by <see cref="P:System.Text.Encoding.WebName" /> is a valid value.</para>
89 <para>If you read an encoded document, then this property will be set to the code page name.</para>
90 <para>If you set this property to a valid code page name, then when serializing, LINQ to XML will serialize with the specified encoding.</para>
93 <attribution license="cc4" from="Microsoft" modified="false" />
94 <para>Gets or sets the encoding for this document.</para>
98 <Member MemberName="Standalone">
99 <MemberSignature Language="C#" Value="public string Standalone { get; set; }" />
100 <MemberSignature Language="ILAsm" Value=".property instance string Standalone" />
101 <MemberType>Property</MemberType>
103 <AssemblyVersion>4.0.0.0</AssemblyVersion>
106 <ReturnType>System.String</ReturnType>
109 <value>To be added.</value>
111 <attribution license="cc4" from="Microsoft" modified="false" />
112 <para>The valid values for standalone are "yes" or "no". These values are not enforced.</para>
115 <attribution license="cc4" from="Microsoft" modified="false" />
116 <para>Gets or sets the standalone property for this document.</para>
120 <Member MemberName="ToString">
121 <MemberSignature Language="C#" Value="public override string ToString ();" />
122 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
123 <MemberType>Method</MemberType>
125 <AssemblyVersion>4.0.0.0</AssemblyVersion>
128 <ReturnType>System.String</ReturnType>
132 <returns>To be added.</returns>
133 <remarks>To be added.</remarks>
135 <attribution license="cc4" from="Microsoft" modified="false" />
136 <para>Provides the declaration as a formatted string.</para>
140 <Member MemberName="Version">
141 <MemberSignature Language="C#" Value="public string Version { get; set; }" />
142 <MemberSignature Language="ILAsm" Value=".property instance string Version" />
143 <MemberType>Property</MemberType>
145 <AssemblyVersion>4.0.0.0</AssemblyVersion>
148 <ReturnType>System.String</ReturnType>
151 <value>To be added.</value>
153 <attribution license="cc4" from="Microsoft" modified="false" />
154 <para>The value is usually "1.0". This value is not enforced.</para>
157 <attribution license="cc4" from="Microsoft" modified="false" />
158 <para>Gets or sets the version property for this document.</para>