Click here to Skip to main content
15,936,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XmlWriter diffWriter = new XmlTextWriter("diffgram.xml", new System.Text.UnicodeEncoding());
                XmlDiff myDiff = new XmlDiff();
                myDiff.Algorithm = XmlDiffAlgorithm.Precise;
                bool bSame = myDiff.Compare("source.xml", "changed.xml", false, diffWriter);
                bool bSameopp = myDiff.Compare( "changed.xml","source.xml",false, diffWriter);



above code is used to find difference between 2 xml files. but the third xml files generated from this code prints some unwanted additional extra tags which are not at all required. for example:
<?xml version="1.0" encoding="utf-16"?><xd:xmldiff version="1.0" srcDocHash="13138024404859952286" options="None" fragments="no" xmlns:xd="http://schemas.microsoft.com/xmltools/2002/xmldiff">


thus i want to remove this tag entirely. how can i achieve it?
Posted
Updated 8-Apr-15 2:54am
v4
Comments
Sinisa Hajnal 8-Apr-15 4:42am    
What have you tried? Working with XML files is easy in .NET, you have whole namespace for working on DOM.
Tomas Takac 8-Apr-15 4:51am    
You can control the formatting in XmlTextWriter via XmlWriterSettings[^] when you create the writer using Create method[^]. That covers first part of your question. I don't understand the other part about adding and removing tags. You need to be more specific.
Member 11460314 8-Apr-15 5:18am    
the second part that describes is there are some tags additional coming inside xml dox which are unwanted for example:
xd:xmldiff version="1.0" srcdochash="9106356682401414995" options="None" fragments="no" xmlns:xd="http://schemas.microsoft.com/xmltools/2002/xmldiff"

thus i want to remove this tag

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900