You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stuart Roebuck <sr...@adolos.com> on 2000/05/09 18:19:41 UTC

[Q] 1.7.3 - Fault with "substring" function?

I'm getting a StringIndexOutOfBoundsException trying to use the XPath  
substring(string, start, length) function.  I've tried a simple:

	<xsl:variable name="test_variable" select="substring("1234",1,2)" />

And this returns the same stack trace (see below).

Is this a known issue, an unknown issue or stupidity on my part?

If it isn't entirely my stupidity, can someone suggest a temporary workaround?

Thanks,

Stuart.


> java.lang.StringIndexOutOfBoundsException: String index out of range:
> -2147483643
	at java.lang.String.substring(String.java, Compiled Code)
	at 
> org.apache.xalan.xpath.FuncSubstring.execute(FuncSubstring.java:116)
	at 
> org.apache.xalan.xpath.Function.execute(Function.java, Compiled Code)
	at 
> org.apache.xalan.xpath.XPath.executeFunction(XPath.java, Compiled Code)
	at 
> org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code)
	at 
> org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code)
	at 
> org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code)
	at 
> org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code)
	at 
> org.apache.xalan.xslt.ElemVariable.getValue(ElemVariable.java, Compiled
> Code)
	at org.apache.xalan.xslt.ElemVariable.execute(ElemVariable.java, 
> Compiled Code)
	at
>  
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java,  

> Compiled Code)
	at
> org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
> Compiled Code)
	at
>  
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java,  

> Compiled Code)
	at
> org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
> Compiled Code)
	at
>  
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java,  

> Compiled Code)
	at
> org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
> Compiled Code)
	at
>  
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java,  

> Compiled Code)
	at
> org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java,
> Compiled Code)
	at
>  
org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java,  

> Compiled Code)
	at
>  
org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement.java,  

> Compiled Code)