on 02-06-2014 10:52 AM
Hi Friends,
I have a simple
XSLT mapping in which I have declared "java.lang.StringBuffer" class and used a method like append in it. This mapping is present in PI 7.31 box.
The XSLT code is something like this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sb="java:java.lang.StringBuffer">
<Record>
<Name>
<xsl:variable name="concatname" select="sb:append('A')"/>
<xsl:variable name="concatname" select="sb:append('B')"/>
<xsl:value-of select="$concatname"/>
</Name>
</Record>
</xsl:stylesheet>
It is throwing an error as below:
Could any of you advise if this is the right
way of calling the class/method in my XSLT code.
Thank you.
Regards,
Subbalaxmi Musunuri
Hi Subbalaxmi,
In sap.help document talks about static method, the java method to be called. May be, you should to wrap that function in a new one being static. Check the example here (page 12) http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f03df013-289f-2e10-acb9-d1fcf782a...
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
I know it's a bit late and I hope you have fixed this issue by now.
Just for history purposes: have you checked the your JDK version. I know there is a problem with StringBuffer append method. Check the NWDS JDK version and the PI JRE version.
It looks like StringBuffer from Java 1.4 spec will work correctly, but you could be running it against an older JRE (1.3).
Check under Window -> Preferences -> Java -> Compiler -> "Compiler And Classfiles" -> "Compiler compliance level" if you have the same JRE version as you server's.
StringBuffer should be replaced with StringBuilder on newer JRE whenever possible.
BR,
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Change this line
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sb="java:java.lang.StringBuffer">
to
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sb="java.lang.StringBuffer">
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.