Ich benutze C#.Xml Elemente überschreiben
Ich habe 2 XML-Dateien, das sind gleichen execpt spezifisches Element Wert aussehen:
Die Originaldatei:
<tasks>
<task id="1" >
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
<CipherData>
<CipherValue>+bv8xdFfDzXai3rB1D+c2voJ/mRkuQHJfV34iWB2wyezR3wxG5UnLmznq4i2emIh4Z+8KukZEKJmM8=</CipherValue>
</CipherData>
</EncryptedData>
<AnotherElements/>
</task>
<task id="2" >
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
<CipherData>
<CipherValue>+bv8xdFfDzXai3rB1D+c2voJ/mRkuQHJfV34iWB2wyezR3wxG5UnLmznq4i2emIh4Z+8KukZEKJmM8=</CipherValue>
</CipherData>
</EncryptedData>
<AnotherElements/>
</task>
...
<tasks>
Und Backup-Datei:
<tasks>
<task id="1" >
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
<CipherData>
<CipherValue>+asd+c2voJ/sdf+8KukZEKJmM8=</CipherValue>
</CipherData>
</EncryptedData>
<AnotherElements/>
</task>
<task id="2" >
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
<CipherData>
<CipherValue>+asd+c2voJ/sdf+8KukZEKJmM8=</CipherValue>
</CipherData>
</EncryptedData>
<AnotherElements/>
</task>
...
<tasks>
Im Fall eines Fehlers im Original Datei, weil das <EncryptedData>
Element Ich möchte alle <EncryptedData>
Element aus der Sicherungsdatei in der ursprünglichen Datei ersetzen.
Was ist der beste Weg, das zu tun?