You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "edA-qa mort-ora-y (JIRA)" <xa...@xml.apache.org> on 2009/01/08 11:02:59 UTC

[jira] Created: (XALANJ-2475) XObject call to str then num fails / different results on multiple calls

XObject call to str then num fails / different results on multiple calls
------------------------------------------------------------------------

                 Key: XALANJ-2475
                 URL: https://issues.apache.org/jira/browse/XALANJ-2475
             Project: XalanJ2
          Issue Type: Bug
      Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects.  Anybody can view the issue.)
          Components: XPath-API
    Affects Versions: 2.7
         Environment: Any platform
            Reporter: edA-qa mort-ora-y


An XObject as obtained via XPath.execute returns different results for each call to str, num, nodeset, or bool.  This quite similar to XALANJ-1335 but I wish to emphasize calling a different function, and that the result is different.

In this case the result cannot be cached and used later as we wish to use a different result.

For example:

System.out.println( object.str() );
int number = object.num() + 5;

The second line does not work so long as the first line exists.  You cannot extract multiple types from the result.

There is nothing to suggest that these functions should have side-effects, nor is it understood why they would.

This type of behaviour is vital in our TestPlan web testing suite which uses dynamic typing. We have no workaround.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2475) XObject call to str then num fails / different results on multiple calls

Posted by "edA-qa mort-ora-y (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661925#action_12661925 ] 

edA-qa mort-ora-y commented on XALANJ-2475:
-------------------------------------------

Evidence to this being a defect is an inconsistency in behaviour.

Given a simple XML:
<root><value name='one'>12</value></root>

And this XPath:
//value[@name='one']

object.str() returns "12" the first time, and empty strings subsequence calls

But if you use this XPath:
string(//value[@name='one'])

object.str(), object.num() all return the correct results any number of times they are called

Indeed it also works with the number() xpath function.

The fact the the NodeSet implementation iterates over the nodes just appears wrong -- there is no reason it should.




> XObject call to str then num fails / different results on multiple calls
> ------------------------------------------------------------------------
>
>                 Key: XALANJ-2475
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2475
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in Xalan projects.  Anybody can view the issue.) 
>          Components: XPath-API
>    Affects Versions: 2.7
>         Environment: Any platform
>            Reporter: edA-qa mort-ora-y
>
> An XObject as obtained via XPath.execute returns different results for each call to str, num, nodeset, or bool.  This quite similar to XALANJ-1335 but I wish to emphasize calling a different function, and that the result is different.
> In this case the result cannot be cached and used later as we wish to use a different result.
> For example:
> System.out.println( object.str() );
> int number = object.num() + 5;
> The second line does not work so long as the first line exists.  You cannot extract multiple types from the result.
> There is nothing to suggest that these functions should have side-effects, nor is it understood why they would.
> This type of behaviour is vital in our TestPlan web testing suite which uses dynamic typing. We have no workaround.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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