[jira] Created: (JAXEN-206) bad order when context is a list of nodes at different depths

View: New views
5 Messages — Rating Filter:   Alert me  

[jira] Created: (JAXEN-206) bad order when context is a list of nodes at different depths

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

bad order when context is a list of nodes at different depths
-------------------------------------------------------------

                 Key: JAXEN-206
                 URL: http://jira.codehaus.org/browse/JAXEN-206
             Project: jaxen
          Issue Type: Bug
          Components: core
    Affects Versions: 1.1.3
            Reporter: Brian Ewins
         Attachments: mismatch.patch

As described by Elliotte on the list:
Consider this:

<z>
 <a>
   <b/>
 </a>
 <c/>
</z>

Suppose the list includes b and c in document order. c's parent
precedes b's parent even though b precedes c

When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returInstead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.

Patch attached, including test case.


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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JAXEN-206) bad order when context is a list of nodes at different depths

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JAXEN-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Ewins updated JAXEN-206:
------------------------------

    Description:
As described by Elliotte on the list:
Consider this:

<z>
 <a>
   <b/>
 </a>
 <c/>
</z>

Suppose the list includes b and c in document order. c's parent
precedes b's parent even though b precedes c

When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returned. Instead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.

Patch attached, including test case.


  was:
As described by Elliotte on the list:
Consider this:

<z>
 <a>
   <b/>
 </a>
 <c/>
</z>

Suppose the list includes b and c in document order. c's parent
precedes b's parent even though b precedes c

When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returInstead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.

Patch attached, including test case.



> bad order when context is a list of nodes at different depths
> -------------------------------------------------------------
>
>                 Key: JAXEN-206
>                 URL: http://jira.codehaus.org/browse/JAXEN-206
>             Project: jaxen
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.3
>            Reporter: Brian Ewins
>         Attachments: mismatch.patch
>
>
> As described by Elliotte on the list:
> Consider this:
> <z>
>  <a>
>    <b/>
>  </a>
>  <c/>
> </z>
> Suppose the list includes b and c in document order. c's parent
> precedes b's parent even though b precedes c
> When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returned. Instead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.
> Patch attached, including test case.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JAXEN-206) bad order when context is a list of nodes at different depths

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JAXEN-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=195443#action_195443 ]

Elliotte Rusty Harold commented on JAXEN-206:
---------------------------------------------

I'll try and patch this in soon. Meanwhile, do you know who to talk to to get committer access back? I don't think I can do it.

How bad is this? Will this only affect someone calling a more-or-less internal method in the API, or is it possible this could cause incorrect XPath evaluation on actual documents?

> bad order when context is a list of nodes at different depths
> -------------------------------------------------------------
>
>                 Key: JAXEN-206
>                 URL: http://jira.codehaus.org/browse/JAXEN-206
>             Project: jaxen
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.3
>            Reporter: Brian Ewins
>         Attachments: mismatch.patch
>
>
> As described by Elliotte on the list:
> Consider this:
> <z>
>  <a>
>    <b/>
>  </a>
>  <c/>
> </z>
> Suppose the list includes b and c in document order. c's parent
> precedes b's parent even though b precedes c
> When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returned. Instead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.
> Patch attached, including test case.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JAXEN-206) bad order when context is a list of nodes at different depths

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JAXEN-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=195447#action_195447 ]

Brian Ewins commented on JAXEN-206:
-----------------------------------

Its not going to affect many people. I remember years ago someone asking on the list about passing in lists - they were using some non-xpath criteria to create the context. But while the example above will only affect people relying on jaxen's contract that it will return nodes in document order, its possible to turn this into an evaluation error for everyone:

XPath xpath = new DOMXPath("local-name(parent::*)");
assertEquals("z", xpath.stringValueOf(context));

> bad order when context is a list of nodes at different depths
> -------------------------------------------------------------
>
>                 Key: JAXEN-206
>                 URL: http://jira.codehaus.org/browse/JAXEN-206
>             Project: jaxen
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.3
>            Reporter: Brian Ewins
>         Attachments: mismatch.patch
>
>
> As described by Elliotte on the list:
> Consider this:
> <z>
>  <a>
>    <b/>
>  </a>
>  <c/>
> </z>
> Suppose the list includes b and c in document order. c's parent
> precedes b's parent even though b precedes c
> When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returned. Instead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.
> Patch attached, including test case.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JAXEN-206) bad order when context is a list of nodes at different depths

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JAXEN-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=195562#action_195562 ]

Elliotte Rusty Harold commented on JAXEN-206:
---------------------------------------------

I've committed this patch and verified that I still have SVN access. Please verify that everything seems fine, and then close this bug. Thanks.

> bad order when context is a list of nodes at different depths
> -------------------------------------------------------------
>
>                 Key: JAXEN-206
>                 URL: http://jira.codehaus.org/browse/JAXEN-206
>             Project: jaxen
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.3
>            Reporter: Brian Ewins
>         Attachments: mismatch.patch
>
>
> As described by Elliotte on the list:
> Consider this:
> <z>
>  <a>
>    <b/>
>  </a>
>  <c/>
> </z>
> Suppose the list includes b and c in document order. c's parent
> precedes b's parent even though b precedes c
> When calling xpath.selectNodes(context) we can supply a list of nodes instead of a single node. By supplying a list containing b and c as described above, and selecting "parent::*", we should get the list [z, a] returned. Instead we get [a, z]. The reason is that DefaultLocationPath does not sort the nodes into document order when there is only a single step in the location path.
> Patch attached, including test case.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email