3.2 Data Represented by the Persistence Format

Consider a back-end data store that contains the fields and field properties described in the following table.

Name

Number

Data Type

Max Length

name

1

string

10

bin

2

bin.hex

8

GUID

3

uuid

16

date

4

dateTime

16

float

6

float

8

flag

7

boolean

2

There are two rows, and the data contained in their fields is shown in the following table.

name

bin

GUID

date

float

flag

sample1

00000000499602d2

{8AC68D3D-8A09-4403-8860-D0E494BBE894}

2008-01-25T13:04:00Z

3.1415926535897932

0

sample2

null

null

2008-02-13T18:49:00Z

null

1

The preceding schema and data can be represented by using the ADO XML Persistence Format as follows:

 <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
   xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
     xmlns:rs='urn:schemas-microsoft-com:rowset'
     xmlns:z='#RowsetSchema'>
 <s:Schema id='RowsetSchema'>
   <s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'>
         <s:AttributeType name='name' rs:number='1' >
             <s:datatype dt:type='string' dt:maxLength='10'  />
         </s:AttributeType>
         <s:AttributeType name='bin' rs:number='2' >
             <s:datatype dt:type='bin.hex' dt:maxLength='8' />
         </s:AttributeType>
         <s:AttributeType name='GUID' rs:number='3'>
             <s:datatype dt:type='uuid' dt:maxLength='16' />
         </s:AttributeType>
         <s:AttributeType name='date' rs:number='4' >
             <s:datatype dt:type='dateTime'  dt:maxLength='16'
                         rs:scale='0' rs:precision='16' />
         </s:AttributeType>
         <s:AttributeType name='float' rs:number='6' >
             <s:datatype dt:type='float' dt:maxLength='8'
                         rs:precision='17' />
         </s:AttributeType>
         <s:AttributeType name='flag' rs:number='7' >
             <s:datatype dt:type='boolean' dt:maxLength='2' />
         </s:AttributeType>
   </s:ElementType>
 </s:Schema>
 <rs:data>
     <z:row name='sample1' bin='00000000499602d2' 
            GUID='{8AC68D3D-8A09-4403-8860-D0E494BBE894}'
            date='2008-01-25T13:04:00Z'
            float='3.1415926535800001' flag='0'/>
     <z:row name='sample2' date='2008-02-13T18:49:00Z' flag='1'/>
 </rs:data>
 </xml>

The absence of an attribute, defined in RowsetSchema, in z:row element means that the field has a null value. For example, the data row with name="sample2" has null values of fields "bin", "GUID", and "float".