Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313989

Summary: [xpath] XPath computation does not honour the editor's selection when in XPath2 mode
Product: [WebTools] WTP Source Editing Reporter: Jesper Moller <jesper>
Component: wst.xpathAssignee: Jesper Moller <jesper>
Status: RESOLVED FIXED QA Contact: David Carver <d_a_carver>
Severity: normal    
Priority: P3 CC: d_a_carver, thatnitind
Version: 3.2   
Target Milestone: 3.2.2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
One line patch none

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...