Bug 213849 - [xslt] [editor] Content assist for XSL attributes
Summary: [xslt] [editor] Content assist for XSL attributes
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xsl (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement with 1 vote (vote)
Target Milestone: 3.1   Edit
Assignee: David Carver CLA
QA Contact: David Williams CLA
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2007-12-25 12:43 EST by David Carver CLA
Modified: 2009-04-30 14:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Carver CLA 2007-12-25 12:43:36 EST
Typically in an XSLT editor, if one is in one of the XSL attributes like @select, XPath content assist is available.   Also, any previously defined or global variables/params are also available in the content assist proposal.

For templates, when creating a named templated,  if any xsl:call-templates statements have been created and not defined, those names are available as content assist to be filled in for the @name attribute.

For match templates, content assist for the various XPath or node operators are available in the editor.


Where possible we should provide as much hints for filling out XSL attributes with content assist proposals, specifically where XPath is involved.
Comment 1 David Carver CLA 2008-03-04 10:36:38 EST
Working on ability to add basic support for select attributes.  The first support will be to allow for a suggestion of XPath functions to be added.  This will leverage Xalan API to obtain a list of available functions.


Comment 2 David Carver CLA 2008-03-05 00:38:08 EST
Added some very basic support for the select statement to provide some hints of available XPath statements.   This support will be refactored and modified over the coming weeks.  Currently it just provides a list of availabe XPath 1.0 statements, and doesn't go into what paramaters are available or any additional semenatic information about the xpath function.

Future enhancements for select will be to include:

1. Variables that have been predefined and are in scope.  Including global paramaters and variables, as well as locally scoped variables.

2. axis items, including ancestor:: parent:: self::, etc.

These similar items should be applied to the @test attributes.

Comment 3 David Carver CLA 2008-03-07 12:18:34 EST
Created a new Preference page under the XSL Category.  This is called XPath Templates.   It holds the predefined XPath and Axis methods.   It reads the predefined functions from the appropriate xml file.  Users may add their own custom defined functions as well.

This will be used to help enhance the content assistance on various XSL attributes.  Some code from the bpel project may be leveraged as well.   This code has been imported into the XSL ui project, but may not stay depending on how useful it ends up being.

Comment 4 David Carver CLA 2008-03-07 12:20:45 EST
jesper I'm ccing you on this since you expressed interest in the XPath content assistance support.

We may need a xsl.common.ui to hold this type of stuff that can go across the XPath Views and the XSL Editing support in the editor.  Right now I'm just shooting to get the built in editor support functioning and then we can refactor it with appropriate unit tests.
Comment 5 David Carver CLA 2008-03-09 22:58:34 EDT
Support has now been added to handle Global Variables as well as locally scoped variables.   There is one issue that is happening with the locally scoped variables.  It is getting all the variables that are within the ancestor template.  This needs to be filtered so that none of the descendant variables are scoped.

The match attribute as well has support for xpath statements and axis content assist.

Comment 6 David Carver CLA 2008-03-22 14:59:36 EDT
Fixed issue with variable proposals and completion where the cursor was not being placed correctly so that it would appear right after the place where the variable was inserted.   This allows variables to  be inserted into the middle of a string.

Also, added the ability to support XSL's ability to insert value-of selections within an attribute by using "{ }" within the attribute.   When a { is found within the attribute, content assistance is available for variables, axis, and xpath statements.

An example would be:

<xsl:template match="/">
   <html>
     <body bgcolor="{$color}">
         <xsl:value-of select="$text"/>
     </body>
</xsl:template>

Content assistance is available for XSL and XPath expressions that can be inserted into the bgcolor attribute.   It only works if there is a { within the attribute text.  This is in addition to any of proposals that are also valid for that particular element.

Comment 7 David Carver CLA 2008-03-22 18:18:14 EDT
The initial support for XSL Content assistance on attributes is implemented so I'm going to close this for now.  There are additional areas for content assistance support including the name and mode attributes on templates, apply-templates, and call-templates.   Those items will have separate bugs opened as enhancements.
Comment 8 David Carver CLA 2008-03-22 18:19:35 EDT
resolving this for 0.5m6, additional content assistance should be opened as enhancements.
Comment 9 David Carver CLA 2008-06-05 21:41:40 EDT
Mass Migration to wtp.inc.xsl
Comment 10 David Carver CLA 2009-04-30 14:25:29 EDT
mass update to 3.1 target due to movement from wtp incubator to wtp source editing lost the original milestones.