Hi,

I have data (selected from a database) which must be presented to a user for editing. This data is fairly complex and there are many records (50+ records a time) which must be edited. We have decided to use an xml datasource bound to the html controls to edit the data. The xml document is then sent back to the server to update the database.

However, this is more tricky than it sounds. We are using the ado schema. But, the schema for an unchanged record is
Code:
<z:row />
, the shema for a changed row is

Code:
<rs:update>
  <rs:original>
    <z:row />
  </rs:original>
  
  <z:row />
</rs:update>
If I bind my controls to the document, the controls change the value of the attributes only, and not the document schema. This means that the structure that I am sending back to the server is one of an unupdated recordset, even though the data has changed. When loaded back into the recordset object, the recordset see's the data as though some other user has changed the data in the database while this xml doc was being persisted, when in actual fact, it is the oposite and the document should update the database.

The solution, I thought, was to use two xslt's. One to output to the client, creating a copy of each row that will act as a reference and another copy which will be used for the binding and updating of the controls. Then the second xslt would then compare the two versions of the data when submitted back to the server, and format these into the ado form. The result will then be inputed into a recordset object and update the database.

Does anyone have a neater way of doing the same thing?