I've got to XML dom's that I want to do a merge on and don't exactly know where to start - I feel this has to be possible, but can't find any examples anywhere.
One DOM is an HTML document - It might look something like this:
The other Dom looks like this
What I need is some C# code to merge these two dom together substituting the values in the second dom for the nodes in the first dom where appropriate... Yes I know I could do a search and replace, but I'm wondering if there's a way to do it with the XML objects in C#?
Any help is as usual, appreciated.
One DOM is an HTML document - It might look something like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
Thank you for contacting <CompanyName />. We here at <CompanyName /> look forward to helping you with your requirements. Please contact us at
<CompanyAddress1 />
<CompanyAddress2 />
<CompanyCity /> <CompanyState/>, <CompanyZip/>
</body>
</html>
The other Dom looks like this
Code:
<CompanyData>
<CompanyName>SomeCompany</CompanyName>
<CompanyAddress1>123 Main</CompanyAddress1>
<CompanyAddress2>Suite A</CompanyAddress2>
<CompanyCity>Seattle</CompanyCity>
<CompanyState>WA</CompanyState>
<CompanyZip>98345</CompanyZip>
</CompanyData>
What I need is some C# code to merge these two dom together substituting the values in the second dom for the nodes in the first dom where appropriate... Yes I know I could do a search and replace, but I'm wondering if there's a way to do it with the XML objects in C#?
Any help is as usual, appreciated.