I have a requirement in which for a complete response a particular tag value needs to be replaced by another value. That tag may occur 3 or 4 times in a response. Could you please help me with this requirement.
Example: In below XML, needs to modify Addr1 tag value
<LocationInfo>
<a:Addr>
<a:Addr1> STREET ADDRESS</a:Addr1>
<a:City>CITYNAME</a:City>
<a:PostalCode>06001</a:PostalCode>
</a:Addr>
<a:DetailedAddr>
<a:Addr1> STREET ADDRESS1</a:Addr1>
<a:City>CITYNAME1</a:City>
<a:PostalCode>06002</a:PostalCode>
</a:DetailedAddr>
</LocationInfo>
Hi,
On order to suggest a direction for a solution you need to clarify some of the requirements
As a concept, a “tag value” is not described by XML standards (AFAIK), so that leaves the question: in the below example what needs to be replaced, is it the name of the element itself, i.e. is it “Addr1” what is between ‘<’ and ‘>’? Or is it the text value of the argument <Addr1>, i.e. is it “STREET ADDRESS” and “STREET ADDRESS1”?
Maybe easiest, if for the below example you also show how the original response looks like and how the final response XML needs to look like?
For one of the above that needs to change, where does the new value come from? Does it come from somewhere inside the incoming request?
From what value inside the request do you know if you need to respond with 2 changed tags (as below), or when it needs to be 3, or when it needs to be 4?
Is it only 2, 3 or 4? Or can it even be more dynamic?
Cheers,
Danny