[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Xalan Extensions

Subject: Xalan Extensions
From: "Earl Spencer" <eapencer74@xxxxxxxxxxx>
Date: Tue, 01 May 2001 14:14:46 -0000
xsl java extension nullpointerexception
Hi List,
I am a newbie to xml stuff and to this list i have been following the list quite for some time . Keep up the good stuff.


I have a small question for the list i just wrote a small extension and i get the following error

Call to extension function failed: method call/new failed: java.lang.NullPointerException

below are the xsl and the java files

xsl file
--------

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:java="http://xml.apache.org/xslt/java"
               version="1.0">
<xsl:template match="/">
  <xsl:apply-templates select="DocumentSummaries/Document"/>
</xsl:template>
 <xsl:template match="DocumentSummaries/Document">
	<xsl:variable name="st">
	    <xsl:value-of select="HtmlBody"/>
       </xsl:variable>
        <xsl:value-of select="java:stringlets.getString($st)"/>
 </xsl:template>
</xsl:stylesheet>

and this is the calss i use for the stringlets
----------------------------------------------
import java.util.*;

public class stringlets
{

 public static String getString(String str)
   {
     int ind1=str.indexOf("Source:");
	String sttt=str.substring(0,ind1);
	 return sttt;
   }
}

but i get an error
-------------------

Call to extension function failed: method call/new failed: java.lang.NullPointerException

am i dooing anything wrong please correct me.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.