Bug 297975

Summary: [xpath] Need to enhance the XPath View to support XPath 2.0
Product: [WebTools] WTP Source Editing Reporter: David Carver <d_a_carver>
Component: wst.xpathAssignee: David Carver <d_a_carver>
Status: RESOLVED FIXED QA Contact: David Carver <d_a_carver>
Severity: normal    
Priority: P3 CC: doug.satchwell, jesper, mukul.gandhi
Version: unspecifiedKeywords: noteworthy, plan
Target Milestone: 3.2 M5   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 261588    
Bug Blocks:    
Attachments:
Description Flags
Adds rudementry support for XPath 2.0 Processor
none
mylyn/context/zip none

Description David Carver CLA 2009-12-16 11:19:48 EST
Currently the XPath view only uses Xalan's XPath implementation for 1.0 to provide the results.   We need to add use of the now fully functional XPath 2.0 PsychoPath processor for executing XPath 2.0 expressions.

Ideally this should be contributed through extension point, but this first round will probably just use the built in support for PsychoPath and Xalan processors.   Users should be able to specify a default, and there does need to be a way to specify namespaces.

Menu items need to be contributed using the org.eclipse.ui.menus extension point and the command/handler framework.
Comment 1 David Carver CLA 2009-12-17 16:27:20 EST
I've added a menu item for editing the Namespaces.  Next up is the selection of the XPath Parser Version to use 1.0 or 2.x
Comment 2 David Carver CLA 2009-12-17 18:57:30 EST
Created attachment 154725 [details]
Adds rudementry support for XPath 2.0 Processor

This patch adds very rudimentry support for XPath 2.0 processor support.  It defaults the processor to the PsychoPath processor by default.  Need to make this a tweakable option via the View Preferences.

At the moment it only supports wrappig a ResultSequence and returning a NodeList.  It doesn't support returning the other sequence types that can occur.

Jesper your thoughts and ideas on extending this to full support of the ResultSequence interface that is returned would be appreciated.  I'm not checking this in just yet.
Comment 3 David Carver CLA 2009-12-17 18:57:37 EST
Created attachment 154726 [details]
mylyn/context/zip
Comment 4 David Carver CLA 2009-12-25 18:25:01 EST
The xpath view has been enhanced to allow the selection of either an XPath 1.0 or XPath 2.0 processor for executing the xpath statement.   Selection of which processor is to be used is done through the View menu under the processor extension point.  It leverages the command and handler framework, so adopters can add their own implementations.

For XPath 2.0 this still works best with those queries that return Nodes, the result sequences are converted into a NodeList for rendering into the view.  When using XPath 2.0 the expressions are not schema aware due to the fact that the WTP DOM doesn't provide the necessary PSVI infoset interfaces.

Marking as fixed.
Comment 5 David Carver CLA 2009-12-25 18:26:22 EST
checked in and tagged.