共用方式為


XmlArrayItemAttribute.Form Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value that indicates whether the name of the generated XML element is qualified.

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

Syntax

'Declaration
Public Property Form As XmlSchemaForm
public XmlSchemaForm Form { get; set; }

Property Value

Type: System.Xml.Schema.XmlSchemaForm
One of the XmlSchemaForm values. The default is XmlSchemaForm.None.

Exceptions

Exception Condition
Exception

The Form property is set to XmlSchemaForm.Unqualified and a Namespace value is specified.

Remarks

The Form property determines whether an XML element name is qualified, based on the World Wide Web Consortium (www.w3.org) specification, Namespaces in XML.

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

The default value, XmlSchemaForm.None, instructs the XmlSerializer to check the schema for the XML document to determine whether the namespace is qualified. For elements, the XmlSerializer checks the value of the schema-element attribute elementFormDefault. For attributes, it checks the value of the schema-element attribute attributeFormDefault. For example, the following XML Schema indicates that the Name element is qualified, while the Number element is unqualified.

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.