JavaScript How to include a call to JavaScript within XSLT? javascript include call function

I am trying to call JavaScript inside XSLT but it keeps on failing. I am using the Xalan namespace. I'm calling Java as well and that works no problem, but for some reason the JavaScript doesn't.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xalan/java" xmlns:xalan="http://xml.apache.org/xalan" xmlns:counter="MyCounter" extension-element-prefixes="counter">
<xsl:template match="/">
    <xalan:component prefix="counter" functions="response">
        <xalan:script lang="javascript">

          function response(name) {
            // Return a string.
            return "" + (name);
          }

        </xalan:script>
     </xalan:component>

    <xsl:value-of select="counter:response('hello')"/> 
    <xsl:variable name="rightNow" select="java:java.util.Date.new()"/><!-- Get date object -->
    <xsl:variable name="formatter" select="java:java.text.SimpleDateFormat.new('MM')"/> <!-- double digit format: append 0 to less than ten -->  
    <xsl:variable name="formattedMonth" select="java:format($formatter, $rightNow)"/> <!-- format it -->
    <p><xsl:value-of select="$formattedMonth"/></p> 
</xsl:template> 
</xsl:stylesheet> 

I get this error in the XML transformer:

<Location of error unknown>java.lang.NoSuchMethodException: For extension function, could not find method java.lang.String.response<ExpressionContext, ]>.
Answer:1

I'm trying to make a program that you can enter the dimensions of a Rubik's cube eg. 13x13x13 and the program tells you how many permutations there are for that Rubik's cube. I have the math to figure ...

I'm trying to make a program that you can enter the dimensions of a Rubik's cube eg. 13x13x13 and the program tells you how many permutations there are for that Rubik's cube. I have the math to figure ...

I've got a range slider which I'm using to control a value in an input box. The values we're using can be quite high on the max end so we wanted finer control for smaller numbers before spanning out ...

I've got a range slider which I'm using to control a value in an input box. The values we're using can be quite high on the max end so we wanted finer control for smaller numbers before spanning out ...

The following code: console.log((var a=5; ++a)); Does not compile, because var is considered a statement, not a function. The following does compile: console.log((a=5, ++a)); And words as expected,...

The following code: console.log((var a=5; ++a)); Does not compile, because var is considered a statement, not a function. The following does compile: console.log((a=5, ++a)); And words as expected,...

I have an object with delimited key and I would like to convert this object into nested object. Anyone know a quick way to do in javascript or node? For example: { 'login': 'my login', ...

I have an object with delimited key and I would like to convert this object into nested object. Anyone know a quick way to do in javascript or node? For example: { 'login': 'my login', ...

  1. convert object with keys to array javascript
  2. convert object with type c#
  3. convert object to array javascript
  4. convert object to array
  5. convert object to array php
  6. convert object to json c#
  7. convert object to json
  8. convert object to string javascript
  9. convert object to string
  10. convert object to json java
  11. convert object to string python
  12. convert object to string c#
  13. convert object to json javascript
  14. convert object to datetime pandas
  15. convert object to array js
  16. convert object to string java
  17. convert object to int c#
  18. convert object to array typescript
  19. convert object to int
  20. convert object to float pandas