You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/04/15 18:42:21 UTC

DO NOT REPLY [Bug 19038] New: - Dynamic params ( as argument in java call)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19038>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19038

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

           Summary: Dynamic params (<xsl:param..> as argument in java call)
           Product: XalanJ2
           Version: 2.5Dx
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: jantonio.illescas@bancoval.es


The stylesheet:

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

<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");