You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Yash Talwar (JIRA)" <xa...@xml.apache.org> on 2005/04/21 17:38:25 UTC

[jira] Commented: (XALANJ-2039) XPath in extensions gives runtime error

     [ http://issues.apache.org/jira/browse/XALANJ-2039?page=comments#action_63400 ]
     
Yash Talwar commented on XALANJ-2039:
-------------------------------------

Hi Marco, Can you please attach the testcase files to this issue to reproduce the problem? Thanks!

> XPath in extensions gives runtime error
> ---------------------------------------
>
>          Key: XALANJ-2039
>          URL: http://issues.apache.org/jira/browse/XALANJ-2039
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan-extensions
>  Environment: Fedora 2 
>     Reporter: Marco Laponder
>     Assignee: Yash Talwar

>
> I am trying to do the following, i define a variable in my xsl file as the following: 
> <xsl:variable name="var1> 
>         <info1 value="test" /> 
>         <info2 value="test" /> 
> </xsl:variable> 
> and I pass thi vaiable to an extension function : 
> <xsl:copy-of select="myext:getdata2($var1)" /> 
> I defined my function as follows: 
> public Document getdata2(Object input){ 
>                 DTMNodeIterator it = (DTMNodeIterator) input; 
>                Document inputDoc = (Document) it.getRoot();    
>         .... 
> } 
> When I dump the inputdoc to file, it contains the data from var1 as I expect. 
> Now I try to get specific data from the input doc with the XPathAPI object, e..g. 
>         XPathAPI.selectNodeList(inputDoc,"/") 
> but this gives met the following error 
> java.lang.ArrayIndexOutOfBoundsException: -1 
>         at org.apache.xml.utils.SuballocatedIntVector.elementAt(SuballocatedIntV 
> ector.java:454) 
>         at org.apache.xml.dtm.ref.DTMDefaultBase._firstch(DTMDefaultBase.java:52 
> 0) 
>         at org.apache.xml.dtm.ref.DTMDefaultBase.getFirstChild(DTMDefaultBase.ja 
> va:965) 
>         at org.apache.xml.dtm.ref.DTMNodeProxy.getDocumentElement(DTMNodeProxy.j 
> ava:605) 
>         at org.apache.xpath.XPathAPI.eval(XPathAPI.java:274) 
>         at org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:211) 
>         at org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:191) 
>         at interchain.ext.XmlProvider.getdata2(XmlProvider.java:203)       

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org