2.3.1.1.2 DataSet Schema Element

If the DataSet Schema element is present, the name of the DataSet object is determined by the following rules:

  • If the name attribute is specified, the name of the DataSet MUST be set to the value of the name attribute.

  • If the name attribute is not specified in the DataSet Schema element, the value of the id attribute of the <schema> element MUST be mapped to the name of the DataSet.

  • If the DataSet Schema element contains one or more child <complexType> elements with a <choice> element compositor, the child <complexType> elements will map to one or more DataTable objects.

  • If the msdata:CaseSensitive attribute is specified within the DataSet Schema element, its value MUST be true or false.

  • If the msdata:CaseSensitive attribute is not specified, the value MUST be false. The value MUST map to the CaseSensitive property on DataSet.

  • If the msdata:Locale attribute is specified within the DataSet Schema element, the value of the msdata:Locale attribute MUST follow [RFC4646]. If the attribute is not specified and msdata:UseCurrentLocale is specified and is equal to true, the Locale property on the DataSet MUST be set to the current local of the computer based on [RFC4646].

  • If msdata:UseCurrentLocale is specified and is equal to false or if msdata:UseCurrentLocale is not specified and msdata:Locale is not specified, the Locale property on the DataSet MUST be "en-us".

  • If the msdata:Prefix attribute is specified, the value will be the Prefix property of the DataSet. If the attribute is not specified, the Prefix property of the DataSet MUST be an empty string.

  • If the DataSet Schema element contains attributes that specify the urn:schemas-microsoft-com:xml-msprop namespace, each attribute name/value pair MUST specify a name/value pair in the ExtendedProperties that exists on the DataSet object.

  • Any additional attribute that is not specified earlier in this section MUST be ignored.

The following schema excerpt illustrates this.

 <?xml version="1.0" encoding="utf-8" ?>
 <xs:schema id="MyDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   <xs:element name="dataset" msdata:IsDataSet ="true">
     <xs:complexType>
       <xs:choice maxOccurs="unbounded">
         <xs:element ref="customer"/>
       </xs:choice>
     </xs:complexType>
   </xs:element>
   <xs:element name="customer">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="CustomerName" />
       </xs:sequence>
     </xs:complexType>
   </xs:element>