xml_3dm/
lib.rs

1//! 3DM - Three-way XML Diff and Merge
2//!
3//! This library provides structure-aware XML merging capabilities.
4//! It supports insert, delete, update, move, and copy operations on subtrees.
5//!
6//! # Overview
7//!
8//! 3DM (3-way Diff/Merge) is an XML tree differencing and merging tool
9//! originally created by Tancred Lindholm as part of his Master's thesis
10//! at Helsinki University of Technology (2001).
11//!
12//! This is a Rust port of the original Java implementation.
13//!
14//! # Key Features
15//!
16//! - Structure-aware XML merging (unlike line-based diff/diff3)
17//! - Supports insert, delete, update, move, and copy operations on subtrees
18//! - No edit history required - only needs the XML files
19//!
20//! # Example Use Case
21//!
22//! A document edited by two reviewers - one moves a paragraph, the other
23//! fixes a spelling error in that paragraph. 3DM automatically integrates
24//! both changes.
25
26pub mod constants;
27pub mod diff;
28pub mod error;
29pub mod matching;
30pub mod measure;
31pub mod merge;
32pub mod node;
33pub mod xml;
34
35// Re-export commonly used types
36pub use constants::*;
37pub use error::{Error, Result};
38pub use matching::{DiffMatching, HeuristicMatching, Matching, TriMatching};
39pub use measure::Measure;
40pub use node::{
41    new_base_node, new_branch_node, BaseNode, BranchNode, MatchArea, MatchType, MatchedNodes,
42    NodeInner, NodeKind, NodeRef, WeakNodeRef, XmlContent, XmlElement, XmlText,
43};
44pub use xml::{
45    parse_file, parse_str, BaseNodeFactory, BranchNodeFactory, NodeFactory, XmlParser, XmlPrinter,
46};
47
48// Re-export merge types
49pub use merge::{
50    ConflictLog, ConflictType, EditLog, EditType, Merge, MergeEntry, MergeList, MergePair,
51    MergePairList, Operation,
52};
53
54// Re-export diff types
55pub use diff::{BfsIndex, Diff, DiffOperation, Patch};