anchor
元素来显式地指定这些添加点,从而“声明”它可以接受所添加的内容。于是,在运行时可以将 XHTML 片段动态地插入到这些文档中。
<!ELEMENT extension (contentExtension+)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT contentExtension EMPTY>
<!ATTLIST contentExtension
file CDATA #REQUIRED>
定义一个或多个帮助系统页面的内容扩展。内容扩展文件的位置由 file
属性指定。
<contentExtension>
<topicExtension content=
"plugin/relative/path/topicExtensionFile.xhml"
path=
"plugin_id/path_to_xhtml_file/anchor_id"
/>
<topicReplace content=
"topicReplaceFile.xhml"
path=
"plugin_id/path_to_xhtml_file/element_id"
/>
</contentExtension>
topicExtension
是用来在目标锚点位置插入内容的标记。topicReplace
标记用来将目标元素内容替换为指定的内容。换而言之,添加的内容既可以添加到目标位置也可以替换目标位置的内容。(在 plugin.xml 文件中)
<extension point=
"org.eclipse.help.contentExtension"
>
<contentExtension file=
"contentExtensionFile.xml"
/>
</extension>
(在 contentExtensionFile.xml 文件中)
<contentExtension>
<topicExtension content=
"xhtml/topicA.xhtml"
path=
"org.xxx.yyy.somePluginId/xhtml/someHelpPage.xhtml/topicAnchor"
/>
</contentExtension>
上述添加项将 XHTML 文件 topicA.xhtml 的内容插入到 path 属性指定的目标帮助系统页面中。在本例中,将把内容扩展插入到插件 org.xxx.yyy.somePluginId 中的 someHelpPage.xhtml 页面中名为 topicAnchor 的锚点位置。
上述添加项将 XHTML 文件 topicA.xhtml 的内容插入到 path 属性指定的目标帮助系统页面中。在本例中,将把内容扩展插入到插件 org.xxx.yyy.somePluginId 中的 someHelpPage.xhtml 页面中名为 topicAnchor 的锚点位置。
Copyright (c) 2000, 2006 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html