1. In Item.xsl define the following namespace:
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
2. Initialize the PageUrl param before the first template
3. Use the PageUrl variable for the Current URL.
Use the following link for function list of DataViewWebPart and ddwrt NameSpace.
http://msdn.microsoft.com/es-ve/library/aa505323(en-us).aspx