2.4.1 DataInstance Element

The DataInstance element can contain one child element named DocumentElement. The DocumentElement MUST contain zero or more first-level child elements, referred to as "row elements". If the DocumentElement is not present, then the DataInstance element MUST contain zero or more row elements. Each row element MUST conform to a DataTable element definition, as specified in section 2.3.2.

A row element MUST contain zero or more first-level child elements, referred to as "column elements". Each column element MUST conform to a DataColumn element definition. A column element's content represents a data value. A NULL data value is represented by the absence of a column element in a row element, or by using the http://www.w3.org/2001/XMLSchema:nil attribute.

The following is an example of a DataInstance element that can appear in a SharePoint DiffGram Data element:

 <SalesDS>
  <Customers diffgr:id="Customers1" msdata:rowOrder="0" >
    <CustId>1</CustId>
    <CustName>C1</CustName>
  </Customers>
  <Customers diffgr:id="Customers2" msdata:rowOrder="1">
    <CustId>2</CustId>
    <CustName>C2</CustName>
  </Customers>
  <Customers diffgr:id="Customers3" msdata:rowOrder="2" >
    <CustId>3</CustId>
    <CustName>C3</CustName>
  </Customers> 
 </SalesDS>

The following rules apply to the row elements within the DataInstance element:

  • Each row element MUST have an urn:schemas-microsoft-com:xml-diffgram-v1:id attribute. The string value of this attribute acts as the row identifier within the scope of the DiffGram Data element. The DataInstance element MUST NOT have two row elements with the same value for the urn:schemas-microsoft-com:xml-diffgram-v1:id attribute.

  • Each row element MUST have an urn:schemas-microsoft-com:xml-msdata:rowOrder attribute whose value MUST be an integer that specifies the 0-based ordinal position of the row element. The DataInstance element MUST NOT have two row elements with the same value for the urn:schemas-microsoft-com:xml-msdata:rowOrder attribute. The value for the urn:schemas-microsoft-com:xml-msdata:rowOrder attribute MUST be less than the count of the rows in the DataInstance element.

  • Each row element can have an urn:schemas-microsoft-com:xml-msdata:hasChanges attribute. If this attribute is specified, the value MUST be "inserted", "modified", or "decent".