Project

Profile

Help

for problem: ArrayIndexOutOfBoundsException

Added by Anonymous about 20 years ago

Legacy ID: #2832584 Legacy Poster: Jamie Martin (jameison)

i see the following when i use a FOR stmt (any for stmt, e.g. for $i in (1) return $i). anyone have any suggestions? i'm not using Saxon with xslt or xquery, so perhaps i'm not setting something up correctly. however, all other XPath expressions seem fine. Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at net.sf.saxon.expr.XPathContextMajor.setLocalVariable(XPathContextMajor.java:213) at net.sf.saxon.expr.ForExpression$MappingAction.map(ForExpression.java:208) at net.sf.saxon.expr.MappingIterator.next(MappingIterator.java:64)


Replies (7)

Please register to reply

RE: for problem: ArrayIndexOutOfBoundsExcepti - Added by Anonymous about 20 years ago

Legacy ID: #2832587 Legacy Poster: Jamie Martin (jameison)

to clarify: this is Saxon 8 and is XPath only

RE: for problem: ArrayIndexOutOfBoundsExcepti - Added by Anonymous about 20 years ago

Legacy ID: #2832933 Legacy Poster: Michael Kay (mhkay)

This looks very much like http://sourceforge.net/tracker/index.php?func=detail&aid=1037892&group_id=29872&atid=397617 which was fixed in 8.1.1. Are you using the latest release? Michael Kay

RE: for problem: ArrayIndexOutOfBoundsExcepti - Added by Anonymous about 20 years ago

Legacy ID: #2833948 Legacy Poster: Jamie Martin (jameison)

thanks for the quick response. i had 8.1 but that fix doesn't appear to resovle the problem i am seeing (i have tried applying the fix described in http://sourceforge.net/tracker/index.php?func=detail&aid=1037892&group_id=29872&atid=397617 to 8.1 and using 8.1.1 and i still see the problem). i know very little about saxon, but based on some other messages i am wondering if this could be caused by reusing a static context?

RE: for problem: ArrayIndexOutOfBoundsExcepti - Added by Anonymous about 20 years ago

Legacy ID: #2833995 Legacy Poster: Michael Kay (mhkay)

OK, well if that's not it then I'll need to see more detail on what you are doing. Can you package it into a reproducible example? Michael Kay

RE: for problem: reproducible example - Added by Anonymous about 20 years ago

Legacy ID: #2834337 Legacy Poster: Jamie Martin (jameison)

//fails on 8.1.1 (and should fail on 8.1) package test; import net.sf.saxon.xpath.XPathEvaluator; import net.sf.saxon.xpath.XPathExpression; import org.xml.sax.InputSource; import javax.xml.transform.sax.SAXSource; import java.io.File; /** * Class XPathExample: * This is the modified version of the test case that is * provided along with theSaxon 8.1.1 down load. / public class XPathExample { public static void main (String args[]) throws java.lang.Exception { // Check the command-line arguments if (args.length != 1) { System.err.println("Usage: java XPathExample input-file"); System.exit(1); } XPathExample app = new XPathExample(); app.go(args[0]); } /* * Run the application */ public void go(String filename) throws Exception { System.out.println("started."); // Create an XPathEvaluator and set the source document InputSource is = new InputSource(new File(filename).toURL().toString()); SAXSource ss = new SAXSource(is); XPathEvaluator xpe = new XPathEvaluator(ss); // Compile the XPath expressions used by the application XPathExpression findLine = xpe.createExpression("for $i in (10, 20) return $i"); findLine.evaluate(); System.out.println("Finished."); } }

RE: for problem: reproducible example - Added by Anonymous about 20 years ago

Legacy ID: #2835942 Legacy Poster: Michael Kay (mhkay)

Thanks for producing the repro. There's actually more than one problem here (or several manifestations of the same problem, if you prefer). If you want to attempt a source fix, it's described at https://sourceforge.net/tracker/index.php?func=detail&aid=1059840&group_id=29872&atid=397617 Michael Kay

RE: for problem: ArrayIndexOutOfBoundsExcepti - Added by Anonymous about 20 years ago

Legacy ID: #2839818 Legacy Poster: Jamie Martin (jameison)

thanks a bunch! -jamie

    (1-7/7)

    Please register to reply