Oxygen
Oxygen

Reputation: 871

How to get only modified nodes using XmlDiffView GetHTML

We have two xml files and need to find the diff of it. For this we are using XMLDiff library. We are able to get the difference but now wanted to have a UI which shows modified nodes. So used XmlDiffView class. Code is as below

  XmlDiffView dv = new XmlDiffView();
        //Load the original file again and the diff file.
        XmlTextReader orig = new XmlTextReader(oldXML);
        XmlTextReader diffGram = new XmlTextReader(diffXML);
        dv.Load(orig,
            diffGram);

        //Wrap the HTML file with necessary html and 
        //body tags and prepare it before passing it to the GetHtml method.

        string tempFile = @"C:\Users\ABC\Desktop\diffView.html";
        StreamWriter sw1 = new StreamWriter(tempFile);
        sw1.Write("<html><body><table width='100%'>");


        dv.GetHtml(sw1);
        sw1.Write("</table></body></html>");
        sw1.Close();
        dv = null;
        orig.Close();
        diffGram.Close();

From above code, dv.GetHtml(sw1); this statement gives html file which shows all modified and non modified nodes, but we need to get only modified nodes information.

How can we get only modified modes information? Any hint, reference would be great help. Thank You!

Upvotes: 5

Views: 1053

Answers (0)

Related Questions