This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

XSL + Java extensions + Xalan + banging my head against the wall


Hi all.  I'm having some trouble with Java extensions.  I've been through 
the xml.apache.org documentation with no luck.

I'm using: Resin, Xerces/Xalan, and JSP to serve up the XML/XSL.

I'm doing something really silly wrong here, but I can't figure it out.  
Resin keeps telling me that it can't find the class file, so my guess is 
that it's a syntax error/omission on my part.

Here's what I'm doing:

<?xml version="1.0"?>
<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	version="1.0"
	xmlns:java="http://xml.apache.org/xslt/java";
	exclude-result-prefixes="java">
.
.[all working stuff]
.
<xsl:template match="/">
	<html>
	<head>
	<title>
</xsl:template>
.
.[all working stuff]
.
<xsl:template match="poetry-line">
	<div class="poetry-line">
	<xsl:if test="@indent">
	<!--2nd attempt-->
	<xsl:param name="indentValue" select="@indent" /><b><xsl:value-of 
select="$indentValue" /></b>
	<xsl:variable name="returnValue" 
select="java:testExtensions.setIndent($indentValue)" />
	<b><xsl:value-of select="$returnValue" /></b>

	<!--1st attempt-->
	<xsl:param name="indentValue" select="@indent" />
	<b><xsl:value-of select="java:testExtensions.setIndent($indentValue)" 
/></b>
	</xsl:if>
	<xsl:apply-templates /></div>
</xsl:template>

This is testExtensions.java, which has been compiled...

import java.util.*;
import java.io.*;
import java.lang.*;

public class testExtensions
{

	public String setIndent(int indent) 	{
			String indents="";
			for (int x=1; x<=indent; ++x) {
				indents = indents + " ";
			}

	return indents;
	}

}

Any help/advice/direction would be greatly appreciated!

Mattio
xmlhack@hotmail.com



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]