HI,
I need help finding the right way to replace a URL that I do not want to pass in my output.
I would like to replace the <link> value (http://feed.google.com) with (http://feed.placeholder.com) how do i do this in a policy? or should i do this with a script?
<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0">
<channel>
<title>New E...</title> <link>http://feed.google.com</link> <description>Syndicated Feed of New...</description>
Solved! Go to Solution.
Thanks guys!
Here's what I ended up going with. Hope this helps someone else here!
var env = context.getVariable('environment.name'); if (env == "production") { targetUrl = "http://production.apigee.net/"; } else if (env == "staging") { targetUrl = "http://staging.apigee.net/"; } else if (env == "development") { targetUrl = "http://development.apigee.net/"; } str = targetUrl + "syndication/"; var rc = context.getVariable("response.content"); var newstr = rc.replace("http://feed.test.com/folder", str); context.setVariable("response.content", newstr);
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |