As is often the case with me, my initial report on this issue was hasty. However, it does still appear to me that there is an issue.

It looks like this is what is occurring:

1. When Saxon sees a custom config file, it appears to examine (perhaps for optimization purposes) some aspects of the stylesheet that it might not otherwise examine, including templates that may never be called.

2. When it does this examination/optimization, one of the user-defined functions in my import file was causing it to throw the exception I mentioned earlier.

I've localized the particular snippet in this function it does not like. Two of the elements in this template has @fill attributes set using an AVT. The expression used is:

I was testing out Saxon 9.5.0.2 in the current oxYgen developer release and found that Saxon was throwing the following error:

java.lang.ArrayIndexOutOfBoundsException

The more detailed version was:

net.sf.saxon.trans.XPathException: java.lang.ArrayIndexOutOfBoundsException at net.sf.saxon.style.XSLTemplate.optimize(XSLTemplate.java:475) at net.sf.saxon.style.PrincipalStylesheetModule.compileStylesheet(Unknown Source)
at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(Unknown Source) at net.sf.saxon.PreparedStylesheet.prepare(Unknown Source) at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:142)
at net.sf.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:97) at ro.sync.xml.transformer.b.f(Unknown Source) at ro.sync.xml.transformer.b.p(Unknown Source) at ro.sync.xml.transformer.b.v(Unknown Source)
at ro.sync.xml.transformer.b.db(Unknown Source) at ro.sync.xml.transformer.b.x(Unknown Source) at ro.sync.exml.editor.xmleditor.fc.kup(Unknown Source) at ro.sync.exml.editor.xmleditor.fc.bvp(Unknown Source)
at ro.sync.exml.editor.xmleditor.fc$4.kwc(Unknown Source) at ro.sync.ui.application.gb.run(Unknown Source)Caused by: java.lang.ArrayIndexOutOfBoundsException---------java.lang.ArrayIndexOutOfBoundsException

A bit of testing indicated the problem stemmed from my using a custom config file. However, it took quite a bit of testing to determine what was actually causing the problem. It appears the issue is that my config file did not explicitly set the uriResolver attribute of the global element in the config file.