Skip to Content
0
Former Member
Jul 31, 2007 at 02:23 PM

XSL transformation error

113 Views

Hello everybody,

I'm tryin' to transform a simple xml file via xslt within a simple java class. Following an excerpt of the java class.

TransformerFactory factory = TransformerFactory.newInstance(); 
Transformer transformer = null; 
Templates template = null; 
StreamSource xmlSource = null; 
StreamSource xslSource = null; 
StreamResult result = null; 
try { 
	// a new StreamSource from a file name 
	xmlSource = new StreamSource(new File("Y:\temp\input\index.xml")); 
	xslSource = new StreamSource(new File("Y:\temp\transformation.xslt")); 
	// a new StreamResult to a file name (it is automatically 
	//closed on exit) 
	result = new StreamResult("data/cars1.html"); 
	// get a new Templates object for this stylesheet 
	template = factory.newTemplates(xslSource); 
	// get a new Transformer from the Templates 
	transformer = template.newTransformer(); 
	// perform the transformation 
	transformer.transform(xmlSource, result);
}
catch(Exception e){
}

When debugging the class I receive the error message

<b>ERROR: 'Syntax error in '($processedChildren, $nextChild)'.'

FATAL ERROR: 'The template couldn't be compiled.'</b>

The expression mentioned in the error message in an excerpt from the XSLT file. The entire expression in the file looks as follows

<xsl:when test="empty(index-of($processedChildren,$nextChild))">

I'm currently using NetWeaver 2004 with JDK 1.4.

Anybody got any suggestions for this problem? Maybe it's due to the index-of function. I'm not quite sure if it's an XPath 2.0 function.

Thanks in advance,

Benjamin