System.Xml [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 To be added System.Attribute System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue | System.AttributeTargets.All)

The belongs to a family of attributes that controls how the serializes, or deserializes, an object. For a complete list of similar attributes, see Attributes That Control XML Serialization.

When applied to a public field or property, the informs the to serialize the member as an XML attribute. By default, the serializes public fields and properties as XML elements.

You can assign the only to public fields or public properties that return a value (or array of values) that can be mapped to one of the XML Schema definition language (XSD) simple types (including all built-in datatypes derived from the XSD anySimpleType type). The possible types include any that can be mapped to the XSD simple types, including , , and enumerations. See the property for a list of XSD types and how they are mapped to.NET data types.

There are two special attributes that can be set with the : the xml:lang (specifies language) and xml:space (specifies how to handle white space) attributes. These attributes are intended to convey information that is relevant only to an application processing the XML. Examples of setting these are shown in the following code.

`[XmlAttribute("xml:lang")] public string Lang; // Set this to 'default' or 'preserve'. [XmlAttribute("space", Namespace = "http://www.w3.org/XML/1998/namespace")] public string Space [Visual Basic] <XmlAttribute("xml:lang")> _ Public Lang As String ' Set this to 'default' or 'preserve'. <XmlAttribute("space", _ Namespace:= "http://www.w3.org/XML/1998/namespace")> _ Public Space As String`

For more information about using attributes, see Extending Metadata Using Attributes.

You can use the word XmlAttribute in your code instead of the longer .

Specifies that the must serialize the class member as an XML attribute.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class and specifies the name of the generated XML attribute.

  The name of the XML attribute that the generates.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class.

  The used to store the attribute.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added

  Initializes a new instance of the class.

  The name of the XML attribute that is generated.
  The used to store the attribute.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  Use the property to specify an XML attribute name when the default value cannot be used. For example, if the XML attribute name is invalid as a member identifier, you can use a valid name for the identifier while setting the to an invalid name.

  Gets or sets the name of the XML attribute.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  The following table lists the XSD simple data types with their.NET equivalents.

  For the XSD base64Binary and hexBinary data types, use an array of structures, and apply a with the property set to "base64Binary" or "hexBinary", as appropriate. For the XSD time and date data types, use the type and apply the with the set to "date" or "time".

  For every XSD type that is mapped to a string, apply the with its property set to the XSD type. However, this does not change the serialization format, only the schema for the member.

  The property is case-sensitive, so you must set it exactly to one of the XSD data types.

  Passing binary data as an XML element is more efficient than passing it as an XML attribute.

  For more information about XML data types, see the World Wide Web Consortium (www.w3.org) document named "XML Schema Part 2: Datatypes".

  XSD data type

  .NET data type

  anyURI

  base64Binary

  Array of objects

  boolean

  byte

  date

  dateTime

  decimal

  double

  ENTITY

  ENTITIES

  float

  gDay

  gMonth

  gMonthDay

  gYear

  gYearMonth

  hexBinary

  Array of objects

  ID

  IDREF

  IDREFS

  int

  integer

  language

  long

  Name

  NCName

  negativeInteger

  NMTOKEN

  NMTOKENS

  normalizedString

  nonNegativeInteger

  nonPositiveInteger

  NOTATION

  positiveInteger

  QName

  duration

  string

  short

  time

  token

  unsignedByte

  unsignedInt

  unsignedLong

  unsignedShort

  Gets or sets the XSD data type of the XML attribute generated by the .

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Xml.Schema.XmlSchemaForm To be added: an object of type 'System.Xml.Schema.XmlSchemaForm'

  The property determines whether an XML element is qualified or unqualified. The property conforms to the 1999 http://www.w3.org specification .

  If the property is set to any value, attempting to set the property to XmlSchemaForm.Unqualified throws an exception.

  The default setting, XmlSchemaForm.None, instructs the to check the schema for the XML document to determine whether the namespace is qualified. If the schema does not specify a value for an individual element or attribute, the uses the elementFormDefault and attributeFormDefault values to determine whether an element or attribute is qualified. The following XML code shows a schema:

  `<schema elementFormDefault="qualified" attributeFormDefault="unqualified"... > <element name="Name"/> <attribute name="Number"/> </schema>`

  When the reads the schema, the value for both the Name and Number is XmlSchemaForm.None, but the Name element is qualified, while the Number element is unqualified.

  Gets or sets a value that indicates whether the XML attribute name generated by the is qualified.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  The property conforms to the http://www.w3.org specification .

  To create namespaces that are associated with prefixes, you must create an object that contains the namespaces and prefixes used in the XML document. The namespace you set for each must match one of the namespaces in the object. When the generates the XML code, it correctly prefixes each attribute name.

  Gets or sets the XML namespace of the XML attribute.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Type To be added: an object of type 'System.Type' To be added

  Gets or sets the complex type of the XML attribute.