none
How to store the value into the xslt variable returned from Javascript function?

    Question

  • I have created a template in ItemStyle.xsl for CQWP.

    I want to store the xsl variable value that is returned from javascript:

    My template is:

    <xsl:template name="DepartmentsTemplate" match="Row[@Style='DepartmentsTemplate']" mode="itemstyle">
    
    <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>                                    
            </xsl:call-template>
        </xsl:variable>     
        <xsl:variable name="CurrSite"/> // I want this variable value to be assigned from javascript function return value.       
    
    <a> <xsl:value-of select="substring-before(@Department,'|')" disable-output-escaping="yes"></xsl:value-of></a>  
    
     </xsl:template> 

    Javascript function is:

    unction getValue() { var url = location.protocol + "//" + location.host + L_Menu_BaseUrl; var n= url.lastIndexOf("/"); var currSite = url.substring(n+1,url.length); return currSite;

    }


    How do I accomplish this?

    Javascript function is defined in another js file that is, it is not written in the ItemStyle.xsl

    Wednesday, October 30, 2013 12:24 PM

Answers