Can someone help me how to replace occurrence of multiple strings with multiple values in XML my application dose not supports some characters so I need to replace these with string value and in UDF element only,
Input XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<Header FileDate="02/12/2015" InputDateFormat="MM/dd/yyyy"/>
<Body DataType="Account">
<Account Name="XYZ" InceptionDate="03/01/2005" DEPT="USD BU" BusinessUnit="WTC" ClientAccountId="123" ISOCurrency="USD" >
<UDF Name="Product" Value="DUMMY"/>
<UDF Name="QUANTITY" Value=" > 10 < 15"/>
</Account>
<Account Name="ABC" InceptionDate="03/01/2005" DEPT="USD BU" BusinessUnit="WTC" ClientAccountId="124" ISOCurrency="USD" >
<UDF Name="Comment" Value="abc 10% & 20 & @ xyz"/>
<UDF Name="Product Code" Value="EMMKTOPP"/>
</Account>
</Body>
<Trailer RecordCount="2"/>
</root>
Replace values in all UDF elements
replace > with "greater than"
replace < with "less than"
replace % with "percent"
replace & with "and"
replace @ with "at"
Output xml should look like: can we write one custom function in XSLT and invoke that once to replace these characters so that in case in future more characters identified update in custom function will automatically take care of calling code
<?xml version="1.0" encoding="UTF-8"?>
<root>
<Header FileDate="02/12/2015" InputDateFormat="MM/dd/yyyy"/>
<Body DataType="Account">
<Account Name="XYZ" InceptionDate="03/01/2005" DEPT="USD BU" BusinessUnit="WTC" ClientAccountId="123" ISOCurrency="USD" >
<UDF Name="Product" Value="DUMMY"/>
<UDF Name="QUANTITY" Value=" greater than 10 less than 15"/>
</Account>
<Account Name="ABC" InceptionDate="03/01/2005" DEPT="USD BU" BusinessUnit="WTC" ClientAccountId="124" ISOCurrency="USD" >
<UDF Name="Comment" Value="abc 10percent and 20 and at xyz"/>
<UDF Name="Product Code" Value="EMMKTOPP"/>
</Account>
</Body>
<Trailer RecordCount="2"/>
</root>