Issue Details (XML | Word | Printable)

Key: XALANJ-1753
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Richard Ng
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XalanJ2

Received java.lang.ArrayIndexOutOfBoundsException when xsl:varaible storing RTF result

Created: 23/Dec/03 02:22 AM   Updated: 11/Dec/07 04:57 PM
Return to search
Component/s: Xalan-extensions
Affects Version/s: 2.3Dx
Fix Version/s: 2.7.1

Time Tracking:
Not Specified

File Attachments:
  Size
Zip Archive ApacheXsl.zip 2003-12-23 02:27 AM Richard Ng 4 kB
Java Source File TestExt.java 2004-01-05 11:06 AM Richard Ng 3 kB
Text File TestLogic2.bat 2004-01-05 11:09 AM Richard Ng 0.3 kB
Java Source File TestTrans.java 2004-01-05 11:08 AM Richard Ng 3 kB
Environment:
Operating System: Windows XP
Platform: All

Bugzilla Id: 25710
Resolution Date: 12/Jul/06 10:50 PM


 Description  « Hide
I created a xsl element extension to return a RTF or a DocumentFragment to
xsl:variable this used to work in 2.3.1. The error I received is the
following:

Exception in thread "main" ; SystemID: file:///D:/Work/Apache/TestVar.xsl;
Line#
: 4; Column#: 28
javax.xml.transform.TransformerException:
java.lang.ArrayIndexOutOfBoundsException: -1
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(Tr
ansformerImpl.java:2367)
        at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode
(Tran
sformerImpl.java:2228)
        at org.apache.xalan.transformer.TransformerImpl.transformNode
(Transforme
rImpl.java:1306)
        at org.apache.xalan.transformer.TransformerImpl.transform
(TransformerImp
l.java:704)
        at org.apache.xalan.transformer.TransformerImpl.transform
(TransformerImp
l.java:1222)
        at org.apache.xalan.transformer.TransformerImpl.transform
(TransformerImp
l.java:1200)
        at com.xx.TestTrans.runExecTrans(Unknown Source)
        at com.xx.TestTrans.main(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at org.apache.xml.utils.SuballocatedIntVector.setElementAt
(SuballocatedI
ntVector.java:426)
        at org.apache.xml.dtm.ref.sax2dtm.SAX2RTFDTM.endDocument
(SAX2RTFDTM.java
:245)
        at org.apache.xml.serializer.ToXMLSAXHandler.endDocument
(ToXMLSAXHandler
.java:222)
        at org.apache.xalan.transformer.TransformerImpl.transformToRTF
(Transform
erImpl.java:1956)
        at org.apache.xalan.transformer.TransformerImpl.transformToRTF
(Transform
erImpl.java:1865)
        at org.apache.xalan.templates.ElemVariable.getValue
(ElemVariable.java:34
8)
        at org.apache.xalan.templates.ElemVariable.execute
(ElemVariable.java:284
)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(Tr
ansformerImpl.java:2362)
        ... 7 more
---------
java.lang.ArrayIndexOutOfBoundsException: -1
        at org.apache.xml.utils.SuballocatedIntVector.setElementAt
(SuballocatedI
ntVector.java:426)
        at org.apache.xml.dtm.ref.sax2dtm.SAX2RTFDTM.endDocument
(SAX2RTFDTM.java
:245)
        at org.apache.xml.serializer.ToXMLSAXHandler.endDocument
(ToXMLSAXHandler
.java:222)
        at org.apache.xalan.transformer.TransformerImpl.transformToRTF
(Transform
erImpl.java:1956)
        at org.apache.xalan.transformer.TransformerImpl.transformToRTF
(Transform
erImpl.java:1865)
        at org.apache.xalan.templates.ElemVariable.getValue
(ElemVariable.java:34
8)
        at org.apache.xalan.templates.ElemVariable.execute
(ElemVariable.java:284
)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates
(Tr
ansformerImpl.java:2362)
        at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode
(Tran
sformerImpl.java:2228)
        at org.apache.xalan.transformer.TransformerImpl.transformNode
(Transforme
rImpl.java:1306)
        at org.apache.xalan.transformer.TransformerImpl.transform
(TransformerImp
l.java:704)
        at org.apache.xalan.transformer.TransformerImpl.transform
(TransformerImp
l.java:1222)
        at org.apache.xalan.transformer.TransformerImpl.transform
(TransformerImp
l.java:1200)
        at com.xx.TestTrans.runExecTrans(Unknown Source)
        at com.xx.TestTrans.main(Unknown Source)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Richard Ng added a comment - 23/Dec/03 02:27 AM
Created an attachment (id=9672)
Attached is the xsl and java soruce file.

Richard Ng added a comment - 05/Jan/04 11:06 AM
Created an attachment (id=9800)
XSL extension java source file

Richard Ng added a comment - 05/Jan/04 11:07 AM
Below is the xsl stylesheet that executes the custom xsl extension
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" exclude-result-prefixes="xps" extension-element-
prefixes="xps" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xps="xalan://com.xx.TestExt" xmlns:lxslt="http://xml.apache.org/xslt">
<xsl:template match="/">
<xsl:variable name="lang">
<xps:getAttribute pathDoc="test" attName="keymask"/>
</xsl:variable>

</xsl:template>
</xsl:stylesheet>

Richard Ng added a comment - 05/Jan/04 11:08 AM
Created an attachment (id=9801)
java source file used to execute the the transformation

Richard Ng added a comment - 05/Jan/04 11:09 AM
Created an attachment (id=9802)
bat file used to execute the java application

Richard Ng added a comment - 05/Jan/04 11:10 AM
I try this in 2.4.1 and I get a NullPointerException, but this works fine in
2.3.1 version

Christine Li added a comment - 19/Feb/04 06:30 AM
*** Bug 24220 has been marked as a duplicate of this bug. ***

Sankar added a comment - 05/Apr/06 11:30 PM
I am getting the same issue in Xalan 2.6 and 2.7. Any work aronds will greatly be appreciated

Yash Talwar added a comment - 11/Apr/06 09:48 PM
This problem is reproducable in version 2.6.5 but has been fixed in latest code in repository.

I get the following output when using with latest code.

Created TransformerCreated Fragment
execute transformer.
Extensions created <?xml version="1.0" encoding="UTF-8"?><keymask>This text</keymask>
Finsished transformer.
<?xml version="1.0" encoding="UTF-8"?>

Please extract the latest code and build the binaries.

Thanks!

Brian Minchau added a comment - 12/Jul/06 10:50 PM
Yash says it is resolved in the latest devopment code. We (the Apache developers) tend not to support older versions of code (we only have so much free time to volunteer). So I'm resolving this as was discussed at the bug triage on July 11, 2006.

Brian Minchau added a comment - 11/Dec/07 04:57 PM
Would the originator of this issue please verify that this issue is fixed in the 2.7.1 release, by adding a comment to this issue, so that we can close this issue.

A lack of response by February 1, 2008 will be taken as consent that we can close this resolved issue.

Regards,
Brian Minchau