언어

DTSXMLDiffAlgorithm 열거형

정의

XML 문서를 비교할 때 사용할 알고리즘을 지정합니다.

public enum class DTSXMLDiffAlgorithm
public enum DTSXMLDiffAlgorithm
type DTSXMLDiffAlgorithm = 
Public Enum DTSXMLDiffAlgorithm
상속
DTSXMLDiffAlgorithm

필드

Name Description
Auto 0

Default. 문서 크기와 예상되는 변경 횟수에 따라 비교 알고리즘을 선택해 줍니다.

Fast 1

XML 트리를 순회하여 노드별로 비교하여 두 XML 문서를 비교합니다. 이 알고리즘은 매우 빠르지만 결과의 정밀도가 떨어질 수 있습니다. 예를 들어, 이동 작업 대신 노드에 추가와 제거 연산을 모두 감지할 수 있습니다.

Precise 2

트리 간 편집 거리를 찾는 알고리즘, 즉 Zhang-Shasha 알고리즘을 기반으로 파일을 비교합니다. 이 알고리즘은 매우 정밀한 결과를 제공하지만, 많은 변경이 있는 대형 XML 문서에서는 매우 느릴 수 있습니다.

예제

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);  
            }  
    }  
}  

적용 대상