[Building Sakai] How to make Dynamic Url for xslt

Bhanu.T.Motupalli bhanu at sankhya.net
Sun Feb 6 23:38:31 PST 2011


Hi,

I need to concatenate 3 strings to make URL dynamically.

XML, XSLT and XPATH Syntax (Toggle Plain Text)

   1.
      <xsl:variable name="userurl">
   2.
      <xsl:choose>
   3.
      <xsl:when test="currentUser/first != ''">
   4.
      <xsl:value-of select="currentUser/first"/>
   5.
      </xsl:when>
   6.
      <xsl:otherwise>
   7.
      <xsl:value-of select="currentUser/userid"/>
   8.
      </xsl:otherwise>
   9.
      </xsl:choose>
  10.
      </xsl:variable>
  11.
       
  12.
      <xsl:variable name="url">
  13.
      <xsl:value-of
select="concat('http://localhost:8080/xsl-portal/site/~',$userurl,'/page/487d2e0a-ca50-440b-a8c2-e98a2cee632c')"/>
  14.
      </xsl:variable>
  15.
      <xsl:text>|</xsl:text>
  16.
       {$url} 
  17.
      <xsl:text>Search</xsl:text>
  18.
       

<xsl:variable name="userurl"> <xsl:choose> <xsl:when test="currentUser/first
!= ''"> <xsl:value-of select="currentUser/first"/> </xsl:when>
<xsl:otherwise> <xsl:value-of select="currentUser/userid"/> </xsl:otherwise>
</xsl:choose> </xsl:variable> <xsl:variable name="url"> <xsl:value-of
select="concat('http://localhost:8080/xsl-portal/site/~',$userurl,'/page/487d2e0a-ca50-440b-a8c2-e98a2cee632c')"/>
</xsl:variable> <xsl:text>|</xsl:text>  {$url}  <xsl:text>Search</xsl:text>  

Here i am not able to get the link, The link is coming like
http://localhost:8080/%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09concat%28%27http://localhost:8080/xsl-portal/site/~%27,$userurl,%27/page/487d2e0a-ca50-440b-a8c2-e98a2cee632c%27%29%0A

Can any one help me to Solve this. I am new to XSLT so please help...

Regards
Bhanu. 
-- 
View this message in context: http://old.nabble.com/How-to-make-Dynamic-Url-for-xslt-tp30861270p30861270.html
Sent from the Sakai - Development mailing list archive at Nabble.com.



More information about the sakai-dev mailing list