Kev Hunter
Kev Hunter

Reputation: 2625

Converting from a Html encoded string to a 'normal' Url

I have a url in an xml documnent which is encoded

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

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

Upvotes: 0

Views: 1088

Answers (2)

Paul Dixon
Paul Dixon

Reputation: 300835

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;eapid=857</Link>

Upvotes: 0

Gumbo
Gumbo

Reputation: 655229

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).

Upvotes: 3

Related Questions