Hi All,
I am a beginner to Unix. So would really appreciate if people out here can help me out.
I have a XML file which has a element <NoteData> in which two values DBHA and DAKO.
I need to search these in all the XML files in a directory and if found in the XML file then replace the below location element value either with DBHA or DAKO as what is contained in the XML element <NoteData>.
I need to make sure that the value substituted happens only in the first Location element.
<?xml version="1.0" encoding="ISO-8859-1"?>
<XmlInterchange xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
XML Schema" Version="1"> <InterchangeInfo>
<Date>2008-10-17T07:17:40.5870000+02:00</Date>
<Source>
<EnterpriseCode>DFD</EnterpriseCode>
<CompanyCode>BRE</CompanyCode>
<OriginServer>DEV</OriginServer>
<LoginName>anker.hansen</LoginName>
<LoginUserEmailAddress>anker.hansen@dsv.com</LoginUserEmailAddress>
</Source>
<Target />
<EDIOrganisation EDICode="00010973" OwnerCode="00010973">
<OrganisationDetails>
<Name>DSV Air & Sea GmbH LKW</Name>
<Location Country="Germany" City="Bremen">DEBRE</Location>
<Addresses>
<Address AddressType="MAIN">
<AddressLine1>Knowledge Center Seafreight</AddressLine1>
<AddressLine2>Schlachte 15-18</AddressLine2>
<AddressCode>Knowledge Center Seafreig</AddressCode>
Thanks & Regards
Karan