Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313989 - [xpath] XPath computation does not honour the editor's selection when in XPath2 mode
Summary: [xpath] XPath computation does not honour the editor's selection when in XPat...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xpath (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Jesper Moller CLA
QA Contact: David Carver CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 18:21 EDT by Jesper Moller CLA
Modified: 2010-08-23 20:18 EDT (History)
2 users (show)

See Also:


Attachments
One line patch (3.67 KB, patch)
2010-07-02 19:44 EDT, Jesper Moller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Moller CLA 2010-05-21 18:21:54 EDT
WTP 3.2 RC2 build (retrieved as wst-sdk-buildrepo-S-3.2.0RC2-20100520232028)

The XPath view does not honour the currently selected node in the editor when evaluating the XPath2 expression, as it does when evaluating as XPath1.

This is fixed by adding 

			 dc.set_focus(new Focus(new DefaultResultSequence(NodeType.dom_to_xpath(node))));

just before the call to eval.evaluate in XPathComputer.
Comment 1 David Carver CLA 2010-05-31 19:58:48 EDT
XPath view is contributed as part of the wst.xsl component.  Targeted this for 3.2.1
Comment 2 Nitin Dahyabhai CLA 2010-07-02 15:30:15 EDT
No patch yet; deferring.
Comment 3 Jesper Moller CLA 2010-07-02 19:44:21 EDT
Created attachment 173337 [details]
One line patch

The patch which adds the line from the description.
I threw in a test case as well.
Comment 4 Jesper Moller CLA 2010-08-23 20:14:35 EDT
Committed to 3_2 branch. Will release once I see how the current 3_2_2 build works out...