Options Property

Microsoft XML Diff

Microsoft XML Diff 1.0 and XML Patch 1.0

XmlDiff.Options Property

Sets all the properties of the XmlDiffOptions enumeration.

[Visual Basic]
Public Property Options() As XmlDiffOptions
[C#]
public XmlDiffOptions Options {set;}

Example

The following example shows how to set the IgnorePI and IgnoreComments enumerations by using the XmlDiff.Options property explicitly.

[Visual Basic]
Imports System
Imports System.Xml
Imports System.IO
Imports Microsoft.XmlDiffPatch

Namespace TestCompare
   Class Class1
      Shared Sub Main()
        Dim myDiff As New XmlDiff()
        Dim diffgramWriter = New XmlTextWriter(New StreamWriter("diffgram.xml"))
        myDiff.Options = XmlDiffOptions.IgnorePI Or XmlDiffOptions.IgnoreComments
        Dim bSame As Boolean = myDiff.Compare("Source.xml", "Changed.xml", False, diffgramWriter)
        diffgramWriter.Close()
      End Sub
   End Class
End Namespace 
[C#]
using System;
using System.Xml;
using System.IO;
using Microsoft.XmlDiffPatch;

namespace TestCompare
{
  class Class1
    {
        static void Main()
          {
            XmlDiff myDiff = new XmlDiff();
            XmlWriter diffgramWriter = new XmlTextWriter( new StreamWriter( "diffgram.xml" ) );
myDiff.Options = XmlDiffOptions.IgnorePI | XmlDiffOptions.IgnoreComments;
            bool bSame = myDiff.Compare("Source.xml", "Changed.xml", false, diffgramWriter);
            diffgramWriter.Close();
            }
    }
}

For information on running the code samples, see Running XmlDiff and XmlPatch Class Code Samples.

There are several other ways to set the comparison options. For examples, see Setting Options that Affect the Comparison.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP, Windows .NET Server

See Also

XmlDiff Class | XmlDiff Members | Microsoft.XmlDiffPatch

© 2002 Microsoft Corporation. All rights reserved.