XmlElementAttribute::Form Property
Gets or sets a value that indicates whether the element is qualified.
Assembly: System.Xml (in System.Xml.dll)
public: property XmlSchemaForm Form { XmlSchemaForm get(); void set(XmlSchemaForm value); }
Property Value
Type: System.Xml.Schema::XmlSchemaFormOne of the XmlSchemaForm values. The default is None.
The Form property determines whether an XML element is qualified or unqualified. The Form property conforms to the World Wide Web Consortium (www.w3.org) 1999 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 setting, XmlSchemaForm.None, instructs the XmlSerializer 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 XmlSerializer 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 XmlSerializer reads the schema, the Form value for both the Name and Number is XmlSchemaForm.None, but the Name element is qualified, while the Number element is unqualified.
Available since 8
.NET Framework
Available since 1.1
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