** DataAccess::UpdateData PARAMTERS lcDiffGram ** oXA is my XMLAdapterObject This.oXA.LoadXML(lcDiffgram) oChild = This.oXA.iXMLDomElement.ChildNodes FOR EACH oNodes IN o oChild.Item(0).ChildNodes ** Testing ?oNodes.oNodeName oElement = oNodes.GetElementByTagName(oNodes.FirstChild.NodeName) FOR EACH oValues IN oElemenet.Item(0).ChildNodes ?oValues.NodeName, oValues.Text *** Here is where I will work with The Elements of the Diffgram *** Now I can handle with different behaviors *** Each oValues has the elements with changes *** I can create the INSERT,UPDATE or DELETE statements ENDFOR ENDFORa Complete sample for testing:
CLEAR CREATE CURSOR ctest (iid int AUTOINC , clave c(5), fecha d) SET MULTILOCKS ON FOR lnCounter=1 TO 5 INSERT INTO ctest (clave,fecha) VALUES (TRANSFORM(RAND()*1000,"@L 99999"),DATE()-(RAND()*50)) endfor CURSORSETPROP("Buffering",5) CURSORSETPROP("keyfieldlist",'iID') * Lets change some values UPDATE cTest SET clave = '00001' WHERE iID = 1 UPDATE cTest SET fecha = DATE(2005,11,02) WHERE iID = 3 UPDATE cTest SET clave = '00099', fecha = DATE(2005,11,01) WHERE iID = 5 ** Create the XMLAdapter oXA = CREATEOBJECT("XMLAdapter") ** Load the XMLupdategram oXA.LoadXML(XMLUPDATEGRAM("ctest")) oChild = oXA.IXMLDOMElement.childNodes FOR EACH oNodes IN oChild.item(0).childNodes ?oNodes.NodeName oEle = oNodes.GetElementsByTagName(oNodes.firstChild.nodeName) FOR EACH oValues IN oEle.Item(0).ChildNodes ?CHR(7),CHR(7),oValues.NodeName,"-->", oValues.Text ENDFOR ENDFORAny comments?