replace a column in a xml file

Jan 12 2005 2:25 AM
Hi Using c# I have done a program such that the program asks for a xml schema file. Then we have to give out the schema file. the program reads the schema file (for all field names) and according to their datatypes, it automatically creates data's for each fields in a new xml file(about 200 data's). For example: "FIRST XML FILE" for string datatype -> say field name "Name( john1,john2,john3...etc)" for about 200 values for decimal -> say field name "Salary(9120.88, 9120.89, 9120.90 ..etc)" for about 200 values.This will be our resultant xml. Leave this apart. "SECOND XML FILE" Now we have another xml file with some field name and data's seperately. This has about 200 values for each field. In this xml file we have a fieldname called "Name". So what I want to do is , that coming to my program , My program while reading the schema file , when it comes across the fieldname "Name" then it should read the "SECOND XML FILE" and copy the fieldname "Name" (ie, its data's ) and insert the values into the "FIRST XML FILE" field name "Name". The others should be the same. This is my requirement. I tried a lot but i couldnt suceed. Pls help me to do this. Let me say it by showing the xml file and how My result,i am expecting to get it. 1) This is the Xml schema file ------------------------------ In the above schema file u can see 2 field names billto_name and dividend. 2) Now my program reads the above file and automatically create values for it as follows ( create a xml file for the above with values in it)(Name this file as "RESULT.XML") --------------------------------------------------------------------------- Castle Hampers0 40 Castle Hampers1 41 Now u can see that it has schema and values for the felds. ie, for about 200 values. I have given just 2 data's. 3) Now There is a another xml file in my project with some meaninful values for the fields.( name this as "SOURCE.XML") --------------------------------------------------------------------------- This is another xml file with a single field and values in it.as follows ACCOUNTS CODES ONLY AFL LICENCED PRODUCT ie, u can see that it has a single field called "billto_name" with some values for it. This field name equals the field name of the the other xml file (previous "RESULT.XML" file) SO NOW MY PROGRAM WHILE READING THE SCHEMA SHOULD CHECK THAT IF THERE IS A FIELD CALLED "BILLTO_NAME" THEN READ DATA'S FROM THE S"SOURCE.XML" AND INSERT THAT DATA'S TO THE PARTICULAR FIELD OF "RESULT.XML" THIS IS MY REQUIREMENT . PLS HELP ME TO DO THIS. SANTHOSH