Bug 297975 - [xpath] Need to enhance the XPath View to support XPath 2.0
Summary: [xpath] Need to enhance the XPath View to support XPath 2.0
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xpath (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: David Carver CLA
QA Contact: David Carver CLA
URL:
Whiteboard:
Keywords: noteworthy, plan
Depends on: 261588
Blocks:
  Show dependency tree
 
Reported: 2009-12-16 11:19 EST by David Carver CLA
Modified: 2010-08-11 17:08 EDT (History)
3 users (show)

See Also:


Attachments
Adds rudementry support for XPath 2.0 Processor (17.80 KB, patch)
2009-12-17 18:57 EST, David Carver CLA
no flags Details | Diff
mylyn/context/zip (168.58 KB, application/octet-stream)
2009-12-17 18:57 EST, David Carver CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.