I have an xml in following form:
<?xml version="1.0" encoding="UTF-8"?>
<query>
<queryParams name="accountID">Star TV</queryParams>
<queryParams name="assetID">Friends</queryParams>
<queryParams name="accountExtRef">Tata</queryParams>
</query>
I need separate xslt to:
-
replace name=”providerID” with name=”ContentProvider” such that the
resulting xml becomes:<?xml version="1.0" encoding="UTF-8"?> <query> <queryParams name="companyID">Star TV</queryParams> <queryParams name="assetID">Friends</queryParams> <queryParams name="accountExtRef">Tata</queryParams> </query> -
replace “Star TV” with Colors such that the XML becomes
<?xml version="1.0" encoding="UTF-8"?> <query> <queryParams name="accountID">Colors</queryParams> <queryParams name="assetID">Friends</queryParams> <queryParams name="accountExtRef">Tata</queryParams> </query>
Please help.
You could do this by simply adding extra templates to the identity transform to match the changes you need.
When applied to your sample XML, the following is output
In this case, it does both changes in one go, but it should be clear enough how to split this into two separate XSLTs if required.