Bug 225418 - [xslt][validation] Hyperlinks for variables
Summary: [xslt][validation] Hyperlinks for variables
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xsl (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: 3.1   Edit
Assignee: David Carver CLA
QA Contact: David Williams CLA
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2008-04-02 15:50 EDT by Doug CLA
Modified: 2009-04-30 14:25 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug CLA 2008-04-02 15:50:32 EDT
It would be nice to have the ability to hover over a parameter and click on it to take you to its declaration.
Comment 1 David Carver CLA 2008-06-05 21:42:05 EDT
Mass Migration to wtp.inc.xsl
Comment 2 Doug CLA 2008-09-01 08:51:29 EDT
Actually, this might not work that well due to the fact that not all variables need to be declared in a stylesheet if that stylesheet is included into another stylesheet (variables with 'tunnel' scope).
Comment 3 David Carver CLA 2008-09-01 10:11:33 EDT
(In reply to comment #2)
> Actually, this might not work that well due to the fact that not all variables
> need to be declared in a stylesheet if that stylesheet is included into another
> stylesheet (variables with 'tunnel' scope).
> 

Correct, the tunnelling would only work one way, within the scope of the current stylesheet or any includes/imports it has.  No different than how the Templates are handled right now.  It would mean that the model would need to keep track of which stylesheet the variable are defined.   Not saying it would be easy, but the model would need to be enhanced eventually.

In the mean time, just having the ability to hyperlink to the variables within the currently defined stylesheet would be helpful.  Most of the stylesheets I've seen are self contained, rarely do you get monsters like the DocBook stylesheets that use lots of includes and imports.


Comment 4 Doug CLA 2008-09-01 10:26:18 EDT
At the moment the model handle global variables only, but it should be easy enough to extend to local variables too. I'll take a look at it.
Comment 5 Doug CLA 2008-09-01 14:07:30 EDT
I've updated the model so that it understands local parameters. As for hyperlinking - this is only useful inside and XPath expression - so Dave maybe its best for you to tacke this?
Comment 6 David Carver CLA 2008-09-01 16:27:50 EDT
Actually, hyperlinking will be useful when I get to adding content assistance on xsl:with-param variables, as hyperlinking to them to see what the default names are and values can be useful during development.   I'll try and code something probably in M3 for this.
Comment 7 David Carver CLA 2008-10-07 16:02:47 EDT
starting to review this.
Comment 8 David Carver CLA 2008-10-08 11:16:28 EDT
Added some initial unit tests for the existing functionality.
Comment 9 David Carver CLA 2008-10-08 17:17:23 EDT
Added the ability to hyperlink for xsl:with-param name attributes...so items like:

<xsl:with-param name="date" select="."/>

will hyperlink to the template that defines Date and to the line that the parameter is defined.

Comment 10 David Carver CLA 2008-10-08 22:46:52 EDT
This may need to be rethought for how to correctly do this for variables used in XPath statements.   The reason being is that we currently don't have each XPath item in it's own region, thus the region we are being passed in the hyperlinkRegion is the starting Offset of the attribute region, not where the mouse pointer may necessarily be.  Unfortunately we need this actual position so that we can parse the XPath and then determine where the variable token is stored and what position it is in the xpath statement.

I have this working for the xsl:with-param statements, but that is fine as it returns the complete value, and no parsing has to be done in that case.

I may close this bug, and open a new bug for the XPath variables hyperlinks, after giving it some over night thought.

Comment 11 David Carver CLA 2008-10-09 09:19:13 EDT
Closing this as the original request is finished...you can hyperlink from with-param entries back to the original param declartion in the declaring template.   I'll open a second bugzilla for the enhancement to go hyperlink in variables defined in XPath statements.
Comment 12 David Carver CLA 2009-04-30 14:25:51 EDT
mass update to 3.1 target due to movement from wtp incubator to wtp source editing lost the original milestones.