Beispiel Mischen test78: Wenn Element verschieden ist, nimm Element von Datei2

Basissteuerung-Datei: cmp78.xml
<?xml version="1.0" encoding="UTF-8"?>
<delivery>
	<list_person>
		<person>
			<name        ident_text="true" />
			<firstname   ident_text="true"  />
			<residence   cmp_text="true"  />
		</person>
	</list_person>
</delivery>
Erläuterung

Eingabe:
Die Datei "test78a.xml" und "test78b.xml" sollen gemischt werden gemäß den Mischregeln der Datei "merge78.xml".
Person "Fischer Ludwig" existiert nur in Datei "test78a.xml".
Person "Fischer Heinz" existiert nur in Datei "test78b.xml".
Person "Fischer Albert" hat verschiedene Werte in Element "<residence>"

Mischregeln:
Das Mischergebnis soll die Personen beider Dateien enthalten
Wenn der Wert des Elements <residence> verschieden ist, dann soll der Wert von Datei"test78b.xml" genommen werden.

Mischergebnis:
Person "Fischer Werner" ist unverändert verglichen zu Datei "test78a.xml".
Person "Fischer Heinz" ist neu verglichen zu Datei "test78a.xml.
Person "Fischer Albert" hat nun den Wert "Paris" im Element "<residence>".

Mischsteuerungs-Datei: merge78.xml
<?xml version='1.0' encoding='UTF-8'?>
<!--
Element <identity>: Explanation of the merge-Attributes:

     merge='??'
            ||
            |If rows are equal:
            |________________________________________________________
            |0 = take no row from input1 or input2
            |3 = merge rows from input1 and input2.
            |________________________________________________________
            |
            If rows are not equal:
            _________________________________________________________
            0 = take no row from input1 or input2
            1 = take only row from input1
            2 = take only row from input2
            3 = take row from input1 and input2.

Element <value>: Explanation of the merge-Attributes:

     merge='???'
            |||
            ||If element/attribute-name are equal but contents are not equal:
            ||_______________________________________________________
            ||0 = take no attribute/element from input1 or input2
            ||1 = take attribute/element from input1
            ||2 = take attribute/element from input2
            ||3 = take attribute/element from input1 and input2 (not possible if path is an attribute)
            ||
            |If element/attribute-name and content are equal:
            |________________________________________________________
            |0 = take no element/attribute from input1 or input2
            |3 = take element/attribute from input1 or input2
            |________________________________________________________
            |
            If element/attribute-name are not equal:
            _________________________________________________________
            0 = take no element/attribute from input1 or input2
            1 = take only element/attribute from input1
            2 = take only element/attribute from input2
            3 = take element/attribute from input1 and input2.

-->
<merge>
<identity path='/delivery/list_person/person'      merge='33' >
    <value path='/residence'                       merge='332' />
</identity>
</merge>
Datei: test78a.xml
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name>
			<firstname>Werner</firstname>
			<residence>Munich</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Ludwig</firstname>
			<residence>Frankfurt</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Albert</firstname>
			<residence>New York</residence>
		</person>
	</list_person>
</delivery>

Datei: test78b.xml
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name>
			<firstname>Werner</firstname>
			<residence>Munich</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Heinz</firstname>
			<residence>Frankfurt</residence>
		</person>
		<person>
			<name>Fischer</name>
			<firstname>Albert</firstname>
			<residence>Paris</residence>
		</person>
	</list_person>
</delivery>

merge-result on stdout
<?xml version='1.0' encoding='UTF-8'?>
<delivery>
	<list_person>
		<person>
			<name>Fischer</name><firstname>Albert</firstname>
			<residence>Paris</residence>
		</person>
		
		<person>
			<name>Fischer</name><firstname>Heinz</firstname>
			<residence>Frankfurt</residence>
		</person>
		
		<person>
			<name>Fischer</name><firstname>Ludwig</firstname>
			<residence>Frankfurt</residence>
		</person>
		<person>
			<name>Fischer</name><firstname>Werner</firstname>
			<residence>Munich</residence>
		</person>
	</list_person>
</delivery>