XSP源中的任务标签 [英] Task Tags in XSP sources
问题描述
在Java源代码中,可以使用(默认情况下)// TODO,// FIXME和// XXX注释将该部分源添加到Eclipse / Domino Designer中的任务视图。
我也想在SSJS中使用它,但是我不能使它工作。在设计师偏好设置常规/编辑/结构化文本编辑器/任务标签,过滤器选项卡中,您可以使用启用搜索任务标签复选框勾选XML类型。受影响的内容类型部分包含作为XP / CC源的文件扩展名的xsp。
但是,SSJS源(实际上是XML标签的属性)中的任何标签都不会显示在任务视图中。
如何将这样的任务标签写入XP / CC源以使其正常工作?
在Domino Designer中,可以通过首选项为大多数编辑器启用搜索任务标签。
ie(常规 - >编辑器 - >结构化文本编辑器 - >任务标签)
但是,报告的行为是因为将任务标签添加到CDATA部分。
CDATA部分基本上是XML的野生野外。
有关参考,请参阅 http://www.w3.org/TR/REC-xml/#sec-cdata-sect 具体:
在CDATA部分中,只有]]>
字符串被识别为标记,因此左尖括号和号可以以字面形式出现;他们不需要(而且不能)使用& lt;
和& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;
因此,为了这个原因,Eclipse XML解析和验证通常会忽略CDATA部分的内容,所以如果<! - TODO - >
或 // TODO
(或任何标签)放入CDATA部分,因此它不被接收。 >
因此,XSP源中任何带注释的服务器端JavaScript都不会出现在任务视图中。
使用该示例代码作为示例,任务视图显示如下。
In Java sources one can use (by default) //TODO, //FIXME and //XXX comments to add that part of source to Tasks view in Eclipse/Domino Designer.
I would like to use it in SSJS too, but I can't make it work. In Designer preferences General/Editors/Structured Text Editors/Task Tags, Filters tab, you can eneable "Enable searching for Task Tags" checkbox and tick XML type. Affected content types section contains "xsp" that is file extension of XP/CC sources.
But any tag in SSJS source (property of XML tag, actually) does not appear in Tasks view.
How to write such task tag into XP/CC source to make it work?
In Domino Designer, searching for Task Tags can be enabled for most editors via the Preferences.
i.e. (General -> Editors -> Structured Text Editors -> Task Tags)
However, the reported behaviour occurs because the Task Tags are added to a CDATA section.
CDATA sections are basically the wild wild west of XML.
For reference, see http://www.w3.org/TR/REC-xml/#sec-cdata-sect specifically:
"Within a CDATA section, only the ]]>
string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using <
and &
"
Therefore, for this reason, the contents of CDATA sections are generally ignored by Eclipse XML parsing and validating. So if <!-- TODO -->
or //TODO
(or any tag) is put into a CDATA section it is not picked up as such.
So as a consequence, any annotated Server-Side JavaScript in XSP source does not appear in the Tasks View.
Using this sample code as an example, the Tasks View displays as follows.
这篇关于XSP源中的任务标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!