I need to insert a tag and value for an element if it does not already exist. This must be done in Java, and easily run in a Windows environment. I've already had it successfully done in Perl, but also need a Java version.
Here's a snippet of an XML file and what I'm logically trying to accomplish:
<NessusClientData_V2>
<Policy>
...
<Report>
...
<ReportHost name="1.2.3.4">
...
<HostProperties>
...
<tag name="HOST_END">Thu Sep 17 17:23:19 2015</tag>
<tag name="system-type">general-purpose</tag>
<tag name="operating-system">MS WIN</tag>
<tag name="ssh-auth-meth">password</tag>
<tag name="ssh-login-used">backup</tag>
<tag name="local-checks-proto">ssh</tag>
<tag name="host-ip">1.2.3.4</tag>
<tag name="HOST_START">Thu Sep 17 17:00:14 2015</tag>
</HostProperties>
...
1) If there is no entry for '<tag name="mac-address">' then create entry (corresponding value pulled from excel spreadsheet or csv file).
2) Continue to next host and do same until EOF.
My output needs to contain all of the original information, but only needs to be added to. Example XML files will be provided upon inquiry.
HI
Contact me for an efficient, perfect, well documented
development of your project according to 100% accuracy
and requirements, with dedicated support.
Thanks
Farah Saif
I have over 7 years of experience as Java Developer. I am expert in java programming , especially that requires dealing and manipulating XML files. I thrive for enhancing the existing programming techniques so as achieve better quality and improved results.