다음을 통해 공유


DTSXMLDiffAlgorithm Enumeration

Specifies which algorithm to use when comparing XML documents.

네임스페이스: Microsoft.SqlServer.Dts.Tasks.XMLTask
어셈블리: Microsoft.SqlServer.XMLTask (in microsoft.sqlserver.xmltask.dll)

구문

‘선언
Public Enumeration DTSXMLDiffAlgorithm
public enum DTSXMLDiffAlgorithm
public enum class DTSXMLDiffAlgorithm
public enum DTSXMLDiffAlgorithm
public enum DTSXMLDiffAlgorithm

Members

Member name Description
Auto Default. Chooses the comparison algorithm for you depending on the size and assumed number of changes in the compared documents.
Fast Compares the two XML documents by traversing the XML tree and comparing it node-by-node. This algorithm is very fast but may produce less precise results. For example, it may detect both an add and remove operation on a node instead of a move operation.
Precise Compares files based on an algorithm for finding the editing distance between trees, also known as Zhang-Shasha algorithm. This algorithm gives very precise results but it may be very slow on large XML documents with many changes.

Imports System
Imports System.Xml
Imports Microsoft.XmlDiffPatch

Namespace TestCompare
   Class Class1
      Shared Sub Main()
        Dim diffWriter = New XmlTextWriter("diffgram.xml", New System.Text.UnicodeEncoding())
        Dim myDiff As New XmlDiff()
        myDiff.Algorithm = XmlDiffAlgorithm.Precise
        Dim bSame As Boolean = myDiff.Compare("source.xml", "changed.xml", False, diffWriter)
        Console.WriteLine("The answer is {0} ", bSame)
      End Sub
   End Class
End Namespace
using System;
using System.Xml;
using Microsoft.XmlDiffPatch;

namespace TestCompare
{
  class Class1
    {
        static void Main()
            {
            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);
    Console.WriteLine("The answer is {0} ", bSame);
            }
    }
}

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

Microsoft.SqlServer.Dts.Tasks.XMLTask Namespace