Hello,
i am reopening thread about my problem since it eveloved quite a bit since i opended my previous thread.
Ok we have same XML files as before:
This one is "Base" XML file ... we will insert and delete nodes from here:
and this one is user-formed XML we will insert nodes from here to "base" XML:
This is my script so far it opens base xml file deletes node <Att08> from it if its there and creates "empty" node <Att08></Att08>
Now here lies the problem. After i delete the node i should open user formed XML and insert everything thats in that file into <Att08> node in base XML.
Here i am lost. I do not know how to do that.
If i load user-formed XML into a array i have no idea how to read values from it and cunstruct a for loop to insert everything thats in that array.
Please i would really require some herelp here.
Thank you !
i am reopening thread about my problem since it eveloved quite a bit since i opended my previous thread.
Ok we have same XML files as before:
This one is "Base" XML file ... we will insert and delete nodes from here:
<Targets AGENT_TOKEN="fbb03f77162ce70f15122343dd6b16eb8de29b6c"> <Target TYPE="oracle_emd" NAME="localhost:3938"/> <Target TYPE="host" NAME="localhost"/> <Target TYPE="oracle_database" NAME="word"> <Property NAME="MachineName" VALUE="localhost"/> <Property NAME="Port" VALUE="1521"/> <Property NAME="SID" VALUE="word"/> <Property NAME="OracleHome" VALUE="c:\app\product\11.2.0\dbhome_2"/> <Property NAME="UserName" VALUE="821212d" ENCRYPTED="TRUE"/> <Property NAME="password" VALUE="061b022" ENCRYPTED="TRUE"/> </Target> <Target TYPE="oracle_listener" NAME="LISTENER_localhost"> <Property NAME="Machine" VALUE="localhost"/> <Property NAME="LsnrName" VALUE="LISTENER"/> <Property NAME="Port" VALUE="1521"/> <Property NAME="OracleHome" VALUE="c:\app\product\11.2.0\dbhome_2"/> <Property NAME="ListenerOraDir" VALUE="c:\app\product\11.2.0\dbhome_2\network\admin"/> </Target> <Att08> </Att08> </Targets>
and this one is user-formed XML we will insert nodes from here to "base" XML:
<Property NAME="Inserted text 1" VALUE="11"/> <Property NAME="Inserted text 2" VALUE="11"/> <Property NAME="Inserted text 3" VALUE="11"/> <Property NAME="Inserted text 4" VALUE="11"/>
This is my script so far it opens base xml file deletes node <Att08> from it if its there and creates "empty" node <Att08></Att08>
[ autoit ]
#include <File.au3> #include<_XMLDomWrapper.au3> #include<Array.au3> $formed_xml = @ScriptDir & "\" & "created.xml" $origin_xml = @ScriptDir & "\" & "original.xml" _XMLFileOpen($origin_xml) $re = _XMLGetChildNodes("/Targets/Att08") _XMLDeleteNode("/Targets/Att08") _XMLCreateChildNode("/Targets","Att08") _XMLCreateChildWAttr("/Targets/Att08","r","","") ; tested insert of a node
Now here lies the problem. After i delete the node i should open user formed XML and insert everything thats in that file into <Att08> node in base XML.
Here i am lost. I do not know how to do that.
If i load user-formed XML into a array i have no idea how to read values from it and cunstruct a for loop to insert everything thats in that array.
Please i would really require some herelp here.
Thank you !