Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bug report? (XSLT): java.lang.String.replace(char, char) not supported)

86643Aug 14 2003
Hi,

The following XSLT should call the java.lang.String.replace method to replace dollars in a text() node.

INPUT:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="dollar.xsl"?>
<element>$test $</element>

STYLESHEET:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:jstring="http://www.oracle.com/XSL/Transform/java/java.lang.String">
<xsl:template match="/element">
<xsl:variable name="str" select="jstring:new(text())"/>
<xsl:value-of select="jstring:replace($str,'$','$$')"/>
</xsl:template>
</xsl:stylesheet>

Output:
XSL-1043 Extension function error: method not found 'replace'

However if I call any other method of java.lang.String it works fine. replace is a non-static method, so according to http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a86030/adx17p12.htm the additional argument to replace(char, char) should be the String instance I want to apply replace on.

I'm using XDK 9.2.0.4.0 and JDK 1.3.1

Any help much appreciated!

Cheers,
Kevin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2003
Added on Aug 14 2003
0 comments
464 views