Hi Martin,
Thank you for reply which much appericate it. Sorry to confuse you. Java variable is from other data store portlet script:
1st portlet:
----------
<script type="text/javascript">
var membershipID = <xsl:value-of select="metadata/item/Membershipnumber" disable-output-escaping="yes" />;
</script>
---------
Which it will be put in this getResult () function var thisResult = "300"; e.g:
2nd portlet:
-----------
This $membershipID will be in xsl code to match other var number:
function getResult () {
var thisResult;
thisResult = $membershipID;
return thisResult;
}
* XSLattribute number for file id list
I only want to fix how to match right vraible number: JSattribute = XSLattribute.
here is renew code below include your quote "xmlns:
js="http://example.com/myfunctions" that no luck.
Hope you can help me this out?
Thank you
Oliver..
---------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace">
<xsl:output method="html" encoding="utf-8"/>
<!-- Declare velocity parameters -->
<xsl:param name="context_path"/>
<xsl:param name="current_path"/>
<msxsl:script language="JavaScript" xmlns:
js="http://example.com/myfunctions">
function getResult () {
var thisResult;
thisResult = $membershipID;
return thisResult;
}
</msxsl:script>
<xsl:template match="/">
<xsl:variable name="JSattribute"><xsl:value-of select="
js:getResult()"/></xsl:variable>
<xsl:variable name="XSLattribute">300</xsl:variable>
<xsl:choose>
<xsl:when test="string(number($JSattribute),string(number($X SLattribute))">
testAttribute is a match number
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>