<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Content Assist</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="../index.html" title="XSL Tools User Documentation"><link rel="up" href="xsleditor.html" title="XSL Editing"><link rel="prev" href="xsleditor.html" title="XSL Editing"><link rel="next" href="xsleditor_templates.html" title="Templates"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ContentAssist"></a>Content Assist</h2></div></div></div><p> | |
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 | |
<span class="emphasis"><em>XPath Templates</em></span> | |
preference page. | |
</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">XPath 2.0 Support</h3><p> | |
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. | |
</p></div><p> | |
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. | |
</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ed_XSLProposals"></a>XSLT Element Proposals</h3></div></div></div><p> | |
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 | |
<a class="xref" href="xsleditor_contentassist.html#fig_XSLProposals" title="Figure 1. XSLT Proposals within Non-XSLT elements">Figure 1, “XSLT Proposals within Non-XSLT elements”</a> | |
. | |
</p><div class="figure"><a name="fig_XSLProposals"></a><p class="title"><b>Figure 1. XSLT Proposals within Non-XSLT elements</b></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/editor/xslproposals.png" align="middle" alt="XSLT Proposals within Non-XSLT elements"></div></div></div><br class="figure-break"></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="SelectTest"></a>Select, Test, and Match Attributes </h3></div></div></div><p> | |
Where ever an xsl element supports a | |
<span class="emphasis"><em>select</em></span> | |
, | |
<span class="emphasis"><em>test</em></span> | |
, or | |
<span class="emphasis"><em>match</em></span> | |
attribute, content assistance is available. This includes support for | |
the following: | |
</p><div class="itemizedlist"><p class="title"><b>Select, Match and Test Assistance</b></p><ul type="disc"><li><p> | |
<span class="emphasis"><em>Variables</em></span> | |
- 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. | |
</p></li><li><p> | |
<span class="emphasis"><em>XPath 1.0</em></span> | |
- 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 | |
<span class="emphasis"><em>axis</em></span> | |
operations. Currently XPath 2.0 is not supported directly, but will | |
be added in the future. | |
</p></li></ul></div><p> | |
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. | |
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ExcludeResultPrefixesContentAssist"></a>Exclude-Result-Prefixes</h3></div></div></div><p> | |
The | |
<span class="emphasis"><em>exclude-result-prefixes</em></span> | |
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 | |
<a class="xref" href="xsleditor_contentassist.html#fig_ExcludeResultPrefixesContentAssist1" title="Figure 2. Exclude-result-prefixes Content Assistance">Figure 2, “Exclude-result-prefixes Content | |
Assistance”</a> | |
. | |
</p><div class="figure"><a name="fig_ExcludeResultPrefixesContentAssist1"></a><p class="title"><b>Figure 2. Exclude-result-prefixes Content | |
Assistance</b></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/editor/ExcludeContentAssist1.png" align="middle" alt="Exclude-result-prefixes Content Assistance"></div></div></div><br class="figure-break"><p> | |
If the attribute has no values defined, then the | |
<span class="emphasis"><em>#all</em></span> | |
value will be available in the list. If #all | |
is already in the | |
attributes value, then no content assistance | |
will be available. | |
</p><div class="figure"><a name="fig_ExcludeResultPrefixesContentAssist2"></a><p class="title"><b>Figure 3. Filtered exclude-result-prefixes proposals</b></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/editor/ExcludeContentAssist2.png" align="middle" alt="Filtered exclude-result-prefixes proposals"></div></div></div><br class="figure-break"><p> | |
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. | |
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Why isn't the XSL Namespace prefix in the proposals? | |
</h3><p> | |
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. | |
</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ed_ModeAssist"></a>Mode attribute assistance</h3></div></div></div><p> | |
Content assistance is available for those xsl elements that support the mode attribute. For XSLT 1.0 | |
these | |
elements are | |
<span class="emphasis"><em>template</em></span> | |
, | |
<span class="emphasis"><em>apply-templates</em></span> | |
, and | |
<span class="emphasis"><em>apply-imports</em></span> | |
. | |
</p><div class="figure"><a name="fig_ModeAssistance"></a><p class="title"><b>Figure 4. Mode attribute assistance</b></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/editor/modeAssistance.png" align="middle" alt="Mode attribute assistance"></div></div></div><br class="figure-break"><p> | |
The proposal list is populated by those modes defined on templates in the current stylesheet, and any | |
of the | |
templates that are | |
<span class="emphasis"><em>included</em></span> | |
or | |
<span class="emphasis"><em>imported</em></span> | |
. | |
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ed_CallTemplateAssist"></a>Call-Template Assistance</h3></div></div></div><p> | |
Any | |
<span class="emphasis"><em>call-template</em></span> | |
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. | |
</p><div class="figure"><a name="fig_CallTemplateAssist"></a><p class="title"><b>Figure 5. Call-Template Assistance</b></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/editor/calltemplate.png" align="middle" alt="Call-Template Assistance"></div></div></div><br class="figure-break"></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ed_href"></a> | |
Include and Import | |
<span class="emphasis"><em>href</em></span> | |
Assistance | |
</h3></div></div></div><p> | |
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. | |
</p><p> | |
To this end, the XSLT editor provides content assistance for the | |
<span class="emphasis"><em>href</em></span> | |
attribute. The scope of the assistance is restricted to the project that the current | |
stylesheet that is being | |
editted resides. | |
</p><div class="figure"><a name="fig_HREFAssistance"></a><p class="title"><b>Figure 6. Include/Import href Assistance</b></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/editor/hrefAssistance.png" align="middle" alt="Include/Import href Assistance"></div></div></div><br class="figure-break"></div></div></body></html> |