I will preface the below with stating i am new to Java in general:
I have the need to insert the a value into an already existing XML in the below case for the attribute "directory".
<?xml version="1.0" encoding="UTF-8"?>
<DTABLEITEM Name="0216.11 neu">
<DVALUE Name="Type" Value="2"/>
<DVALUE Name="Workspace" Value="ST_0216.11.ARD"/>
<DVALUE Name="IntSetupFile" Value=""/>
<DVALUE Name="IntDocPlotCmd" Value=""/>
<DVALUE Name="Directory" Value=""/>
<DVALUE Name="Resource" Value=""/>
/DTABLEITEM>
Below is an example of code that works in one use case where i was able to replace a value easily.
#foreach ($item1 in $xmlf1.find("/."))
$item1.toString().replace("<<wfp.Macro_Settings_Name/>>","(Broken or Missing) <<wfp.Macro_Settings_Name/>>")
#end
The below returns my XML without any modifications but after many hours searching i cannot find anything that works for me either i need a way of replacing that whole line as a string or a way to set the value neither of which i have been successful with.
I understand the below is simply loading the XML and printing
#foreach ($item1 in $xmlf1.find("/."))
$item1
#end