Hello,
I have two xml files which are identical almost identical. #1 holds all
possible values to the application. #2 holds a selected subset of values
which should overwrite the values of the first where identical.
ie.
--#1---
<?xml version="1.0" encoding="UTF-8"?>
<instance>
<environments>
<environment range="all">
<configfiles>
<configfile filename="%instance%.rsp">
<setting stanza="[webseal-config]" key="-name" value="My
Instance"/>
<setting stanza="[webseal-config]" key="-username"
value="my_user"/>
<setting stanza="[webseal-config]" key="-password"
value="dummy-pwd"/>
</configfile>
</configfiles>
</environment>
</environments>
</instance>
···
-------
--#2---
<?xml version="1.0" encoding="UTF-8"?>
<instance>
<environments>
<environment range="all">
<configfiles>
<configfile filename="%instance%.rsp">
<setting stanza="[webseal-config]" key="-password"
value="secret123"/>
<setting stanza="[webseal-config]" key="-host"
value="main_server"/>
</configfile>
</configfiles>
</environment>
</environments>
</instance>
------
What I need is a result-set that looks like this that I can do some
xpath on...
<?xml version="1.0" encoding="UTF-8"?>
<instance>
<environments>
<environment range="all">
<configfiles>
<configfile filename="%instance%.rsp">
<setting stanza="[webseal-config]" key="-name" value="My
Instance"/>
<setting stanza="[webseal-config]" key="-username"
value="my_user"/>
<setting stanza="[webseal-config]" key="-password"
value="secret123"/>
<setting stanza="[webseal-config]" key="-host"
value="main_server"/>
</configfile>
</configfiles>
</environment>
</environments>
</instance>
------
In general what has happend is that the two results have merged. Results
from #2 have overwritten #1 where identical.
It looks like a rather simple "Merge" to me but I can't figure out how
to do this in RMXML
I would very much appreciate your help! Thank you
//Erling
--
Posted via http://www.ruby-forum.com/.