A user create a extended function which calls document function,
ArrayIndexOutOfBoundsException occurs.
When a test case runs, the following exception shows up.
$ ./make.csh // Compiling test case
$ ./run.csh // Run test case
node count: 1
node count: 1
ERROR: '-1'
javax.xml.transform.TransformerException: java.lang.ArrayIndexOutOfBoundsException: -1
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:752)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:357)
at sample.xslt.Test.main(Test.java:39)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at com.sun.org.apache.xml.internal.utils.SuballocatedIntVector.elementAt(SuballocatedIntVector.java:442)
at com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM2._exptype(SAX2DTM2.java:1905)
at com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase.getNodeType(DTMDefaultBase.java:1838)
at com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl.getNodeName(SAXImpl.java:1055)
at com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy.getNodeName(DTMNodeProxy.java:188)
at sample.xslt.ExtFunc.test(ExtFunc.java:12)
at GregorSamsa.template$dot$0()
at GregorSamsa.applyTemplates()
at GregorSamsa.transform()
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:617)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:745)
... 2 more
---------
java.lang.ArrayIndexOutOfBoundsException: -1
at com.sun.org.apache.xml.internal.utils.SuballocatedIntVector.elementAt(SuballocatedIntVector.java:442)
at com.sun.org.apache.xml.internal.dtm.ref.sax2dtm.SAX2DTM2._exptype(SAX2DTM2.java:1905)
at com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase.getNodeType(DTMDefaultBase.java:1838)
at com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl.getNodeName(SAXImpl.java:1055)
at com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy.getNodeName(DTMNodeProxy.java:188)
at sample.xslt.ExtFunc.test(ExtFunc.java:12)
at GregorSamsa.template$dot$0()
at GregorSamsa.applyTemplates()
at GregorSamsa.transform()
at com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:617)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:745)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:357)
at sample.xslt.Test.main(Test.java:39)