Perl script using XML parser to read values in text file and replace it in xml file
how to read xml tag and replace value from text file value. if an entry value is null in install.properties then same has to be updated in property.xml and if entry value is null xml it should get updated with text file value
install.properties text file
TYPE = Patch
LOCATION =
HOST = 127.1.1.1
PORT = 8080
property.xml file before values are replaced
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="TYPE">Release</entry>
<!-- tst -->
<entry key="LOCATION">c:/release</entry>
<entry key="HOST">localhost</entry>
<entry key="PORT"></entry>
</properties>
property.xml file after values has been replaced
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="TYPE">Patch</entry>
<!-- tst -->
<entry key="LOCATION"></entry>
<entry key="HOST">127.1.1.1</entry>
<entry key="PORT">8080</entry>
</properties>