XSL Tools extends the existing content assistance support of the XML Editor to provide content assistance for several XSL namespace attributes. The content assistance provided covers the available XPath statements as defined in the XPath Templates preference page.
Currently XPath 2.0 is not supported directly. However, a user can add this support if they need it by adding the missing XPath functions to the XPath Templates.
To initiate content assistance press CTRL + SPACE or CMD + SPACE. This will bring up a dialog that will contain any proposals that are available. If no proposals are available an message will be displayed in the status bar.
Since XSLT is a templating language, it's elements must be able to be added to the various markup it includes. The XSLT Editor will provide content assistance and proposals for XSLT elements that are available to be used within non-XSLT namespaced elements. This is depicted in Figure 1, “XSLT Proposals within Non-XSLT elements” .
Where ever an xsl element supports a select , test , or match attribute, content assistance is available. This includes support for the following:
Select, Match and Test Assistance
Variables - both local and global variables are supported within the current stylesheet. Any local or global variable will be added to the list and the name is prefixed with a dollar sign $ symbol.
XPath 1.0 - XPath 1.0 is supported through the use of templates. All of the XPath 1.0 and XSLT xpath extension functions are available, as well as axis operations. Currently XPath 2.0 is not supported directly, but will be added in the future.
Content assistance for the select and test attributes is intelligent enough to know that it is within an XPath expression, and will try to determine and provide content assistance based on the current cursor position. If a word has been partially typed it will filter the available assistance.
The exclude-result-prefixes attribute in both XSLT 1.0 and XSLT 2.0 allows for the exclusion of certain namespace declarations in the output document. The content assistance populates a list of available namespaces that have been defined in the stylseheet and provides them as proposals as shown in Figure 2, “Exclude-result-prefixes Content Assistance ” .
If the attribute has no values defined, then the #all value will be available in the list. If #all is already in the attributes value, then no content assistance will be available.
Content assistance is intelligent enough to know when a namespace prefix is already in the list of excluded namespaces. In this case it will not show the namespace in the proposal list.
Currently the xsl prefix or any prefix that uses the XSL namespace is excluded from the list. This may be changed at a future date. This will depend on user feedback.
Content assistance is available for those xsl elements that support the mode attribute. For XSLT 1.0 these elements are template , apply-templates , and apply-imports .
The proposal list is populated by those modes defined on templates in the current stylesheet, and any of the templates that are included or imported .
Call Named templates have content assistance available for their name attributes. This will provide a list of called-templates that have been used, but have not yet been defined or overridden within the current stylesheet.
Any call-template xslt element has content assistance available for it's name attribute. This will provide a list of possible XSLT named templates that can be called from the current stylesheet. This takes into effect all included and imported stylesheets as well as those defined in the current stylesheet.
XSLT stylesheets have the ability to import and include other stylesheets. This allows for a modular structure for the templates to be created. It also allows for easier maintenance. However, if one is working with a large project like the DocBook Projects stylesheets it can be difficult to remember the names and locations of all the stylesheets.
To this end, the XSLT editor provides content assistance for the href attribute. The scope of the assistance is restricted to the project that the current stylesheet that is being editted resides.