0

I have a xml file which contains some path at multiple places.

Now I want to fetch value from a .properties file mentioned and replace part of path where ever it is present in xml.

Like,let's consider I have a xml file as below.

<?xml version="1.0" encoding="ISO-8859-1"?>
...
...
<classpath>

      <pathelement location="/profiles/sh/finalFolder/Apache/example.jar" />

</classpath>

<property name="executable" value="/profiles/sh/finalFolder/Apache/instjamr/install" />

<fileset dir="/profiles/sh/finalFolder/Apache/ant"/>

this xml file conatins path /profiles/sh/finalFolder with some suffix at many places.

Now, I have a path.properties file which contains (key,value) pairs such as

FinalFolder=/new/final/exit (user can edit value anytime in property file)

I want to replace the path with the value mentioned in .properties file for the key FinalFolder.

so now finally, I need to write a code in .sh file to do the job. Please help,Thanks in advance.

(please don't mark this question as duplicate as I din't find a approriate/implementable answer for my question)

Magoo
  • 77,302
  • 8
  • 62
  • 84
CodingOwl
  • 156
  • 1
  • 11
  • http://stackoverflow.com/q/42362500/1030675 – choroba Mar 09 '17 at 13:59
  • @choroba thanks for the help but the link you suggested is based on perl scripting and need installation of perl and a xsh tool as well(which you maintain as mentioned by you). and unfortunately I cant do that in my office computer. – CodingOwl Mar 09 '17 at 14:56
  • You will need a tool to handle the XML, xsh or something else. – choroba Mar 09 '17 at 15:08

0 Answers0