Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-1485

Dynamic params (<xsl:param..> as argument in java call)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.5Dx
    • None
    • parse-or-compile, XSLTC
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • None
    • Operating System: Other
      Platform: Other
    • 19038

    Description

      The stylesheet:

      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>

      <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:bfc="http://www.bancoval.es/bfc"
      xmlns:Locale="java.util.Locale"
      xmlns:String="java.lang.String"
      xmlns:ResourceBundle="java.util.ResourceBundle">

      <!-- Locale -->
      <xsl:variable name="language" select="String:new('es')"/>
      <xsl:param name="country"/>
      <xsl:variable name="locale" select="Locale:new($language,$country)"/>
      <xsl:variable name="resourceBundle"
      select="ResourceBundle:getBundle('es.bancoval.multilingual.EJBResourceBundle',$locale)"/>

      <!-- text -->
      <xsl:template name="translate">
      <xsl:param name="code"/>
      <xsl:value-of select="ResourceBundle:getString($resourceBundle,$code)"/>
      </xsl:template>
      </xsl:stylesheet>

      Causes the compile errors:

      Cannot convert argument/return type in call to method
      'java.util.Locale.new(java.lang.String, reference)'
      Cannot convert argument/return type in call to method
      'java.util.ResourceBundle.getBundle(string, void)'
      Cannot find external method 'java.util.ResourceBundle.getString' (must be public).

      In xalan or saxon works fine.

      Of course the param country is set before transformation with:

      transform.setParameter("country", "ES");

      Attachments

        Activity

          People

            santiago.pericasgeertsen@sun.com Santiago Pericas-Geertsen
            jantonio.illescas@bancoval.es Jose A. Illescas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: