tags:

views:

474

answers:

2

I have a url in an xml documnent which is encoded

<Link>http://www.sample.com/test.asp?goto=HOTWIZ%26eapid=857&lt;/Link&gt;

I would like to convert that into a Url in the outputed Html.

I can output a link ok but i need the %26 to be converted to an &

I assume i could use some sort of replace functionality in XSLT but I imagine there is a more elegant solution

Cheers

To clarify the intent, is should be two seperate parameters, the url is stored in an xml document so needs the url needs to be encoded

+3  A: 

There is a semantic difference between …?foo=bar&baz and …?foo=bar%26baz. The first is two arguments (foo with the value bar and bar with an empty value) while the second is just one argument (foo with the value bar&baz).

Gumbo
Indeed. If that was supposed to be two parameters, the upstream code that generated it is wrong and needs to be fixed.
bobince
Hi it was supposed to be two parameters
Kev Hunter
You'll need to look at the code that spits that out then, you can't really 'fix up' this kind of mangled URL once it has been generated, without losing significant information.
bobince
A: 

The & has been urlencoded (%26) rather than entity encoded - for a more "pure" xml approach you would entity encode it as &amp;

<Link>http://www.sample.com/test.asp?goto=HOTWIZ&amp;amp;eapid=857&lt;/Link&gt;
Paul Dixon