Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Has the Element been Modified ? [Thread Next] Re: Has the Element been Modified ?To: NULL Date: 4/1/2006 2:19:00 PM "GMG" <nospam@nospam> wrote in message news:ePi60$VVGHA.424@T...... > I was thinking of cloning the XMLDocument when first loaded and later > comparing that Cloned (original) XMLDocument to the working version looping > through each element. What do you think of this approach ? > > "Umut Alev" <UmutAlev@d...> wrote in message That's quite expensive and messy. The fact is it will be your code that actually changes the element as a result of a user interaction. You could keep track of what has changed at the point the change is made. For example an additional attribute indicating the element is 'dirty' or maintaining an array of XML elements that have been modified. My preference revolves around the fact that an XML structure ultimately needs to be persisted to a set of relational records. I reserve the attribute 'action' as an indicator to a change and the action needed 'update', 'new', 'delete' but this happens more at a 'record' level than a 'field' level (using the terms lightly). I also use the action value of 'dirty' to mark parent nodes in a heirachy having descendants that have had some change. It's then a fairly simple thing to extract only changed content from the XML for posting back to the server. Anthony. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
