xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ROSSEL Olivier (CIMPA)" <olivier.ros...@airbus.com>
Subject Java mixed with XSLT.
Date Wed, 05 May 2004 17:17:07 GMT
I have such a statement:

     <xsl:param name="e" select="string(@e)"/>
     <xsl:param name="p"
select="java:util.regex.Pattern.compile('\$[0-9a-zA-Z]+')"/>
     <xsl:param name="m" select="java:matcher($p,$e)"/>

This statement is supposed to occur at the beginning of a template
and retrieve a "e" parameter, then use Java1.4 regexp on it.
Everything works fine, except the last line which throws an
IllegalArgumentException.
That's quite strange because: $p is a Pattern, $e is a String
(i checked that with the code given at the end of this message) and
p.matcher(CharSequence)
exists in the Javadoc. Please note that the method signature precises
"CharSequence"
and $e is a String (which subclasses ClassSequence).


Here is my working debugging code:

     <xsl:param name="e" select="string(@e)"/>
     <xsl:param name="eClass" select='java:getClass($e)'/>
     <xsl:param name="eClassName" select='java:getName($eClass)'/>
     <xsl:param name="p"
select="java:util.regex.Pattern.compile('\$[0-9a-zA-Z]+')"/>
     <xsl:param name="pClass" select='java:getClass($p)'/>
     <xsl:param name="pClassName" select='java:getName($pClass)'/>
     <xsl:param name="m" select="java:pattern($p)"/>
     <xsl:param name="mClass" select='java:getClass($m)'/>
     <xsl:param name="mClassName" select='java:getName($mClass)'/>

It works fine and returns expected values for everything.

Any idea?

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message