Samples

SamplesXml

Code

Config

API Docs

Download

Neolectric

UrlEncoding

Encoding text to create valid URLs

Some values from a databse query...

<dxp:DbAction value="query" dbcon="demo" store="items">
 <dxp:Cp name="stmt">select distinct item from auction</dxp:Cp>
</dxp:DbAction>
Eternal Battery
Startup.com Stock
Herbal Youth Tonic
Super WhamoBots

Using them as-is creates urls that contain spaces

<table>
 <dxp:LoopMatrix value="${items}" cols="0">
  <tr><td><a href="http://mysite.not/somepage.dxp?name=${0}">${0}</a></td></tr>
</dxp:LoopMatrix>
</table>

If you mouseover these links you'll see spaces in the parameters appended to the links.
These are invalid URLs. Some servers will compensate. You may not be so lucky with other characters.

Eternal Battery
Startup.com Stock
Herbal Youth Tonic
Super WhamoBots

UrlEncode the content you want to include in links to create legal URLs.

<table>
 <dxp:LoopMatrix value="${items}" cols="0">
 <dxp:UrlEncode value="${0}" store="urlitem"/>
 <tr><td><a href="http://mysite.not/somepage.dxp?name=${urlitem}">${0}</a></td></tr>
</dxp:LoopMatrix>
</table>

If you mouseover these links you'll see that + signs have replaced the spaces.
Other special characters will also be converted when necessary.

Eternal Battery
Startup.com Stock
Herbal Youth Tonic
Super WhamoBots

The + signs will be removed when the URL is decoded by the server