TreeMatcher

com.phasmidsoftware.xmldoc.merge.TreeMatcher
object TreeMatcher

First matching prototype for idml's eventual 3-way merge (see MERGE.md): matches two GenericElement trees purely by their literal Self attribute value.

This deliberately does not attempt any content/structural heuristic matching (the "3dm-style" fallback MERGE.md describes for un-identified content) - it only reports what Self alone can tell us. That's a real scope limit: nodes with no Self at all (most obviously, story text) never appear in the result, in either the matched or the unmatched sets. It also assumes Self is unique within each tree (a real IDML invariant); if that's ever violated, whichever node is visited last silently wins the slot in the index, since this is meant as a starting point, not a validator of well-formed IDML.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Matches two trees by their nodes' Self attribute values.

Matches two trees by their nodes' Self attribute values.

Value parameters

left

the first tree (e.g. the base, in a 3-way merge).

right

the second tree (e.g. one of the two modified versions).

Attributes

Returns

a Matching of the two trees.