XPath 感知 XML 模板或内容辅助
我想创建一个自定义 XML 编辑器,它可以提供基于当前 XPath 的模板或内容辅助。 使用扩展点 org.eclipse.ui.editors.templates 创建模板使其可用于整个上下文类型,这有点太简单了。
当谷歌搜索时,我得到了 oXygen 的链接,谁可以处理这个问题,即:
...XPath 感知内容助手显示函数和轴(所有文档都包含 W3C 规范中的部分)、变量和参数以及上下文中元素和属性的名称测试。
我猜我'需要使用 WTP XML 编辑器吗?
I want to create a custom XML editor that can offer templates or content assists based on the current XPath.
Creating templates using the extension point org.eclipse.ui.editors.templates
makes it available to the entire context type, which is a bit too simple.
When googling I get links to oXygen who can handle this, i.e:
...XPath aware content assistant showing functions and axes (all documented with sections from the W3C specification), variables and parameters as well as name tests for elements and attributes in context.
I am guessing i'll need to use the WTP XML editor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
需要使用 WTP XML?编辑?鉴于您研究过的选项,我不明白您的意思。 <氧气/>是功能齐全的 XML 编辑器,可以独立使用,也可以作为 Eclipse 插件使用;每个许可证需要花费一点钱(300 美元以上),但如果您负担得起,请继续使用它。它具有您正在寻找的XPath 支持。
我以前用过它并且非常满意。
Need to use the WTP XML? Editor? I don't understand what you mean, given the option you've researched. <oXygen/> is fully-functioned XML editor, either standalone or as an Eclipse plugin; it costs a bit of money ($300+) per license, but if you can afford it, go ahead and use it. It's got the XPath support you're looking for.
I've used it before and was very happy with it.
你可以。当 WTP XML 编辑器对
org.eclipse.wst.sse.ui.completionProposal
扩展点的贡献被调用时,它们会查找相关的 DOM 节点和文本位置并找出建议的内容。对于贡献更多“计算机”没有人为的限制。您可以使用org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(CompletionProposalInitationContext, IProgressMonitor)
或从 XML 内容辅助模板查看它是如何根据 XML 架构语法的 DTD 完成的使用org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer#computeCompletionProposals(CompletionProposalInitationContext, IProgressMonitor)
附带在 XML UI 插件中。You can. When the WTP XML Editor's contributions to the
org.eclipse.wst.sse.ui.completionProposal
extension point are invoked, they look up the relevant DOM Node and text location and figure out what to propose. There's no artificial limitation on contributing more "computers". You can see how it's done against the DTD of XML Schema grammar usingorg.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor)
or from the XML content assist templates that ship in the XML UI plug-in usingorg.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer#computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor)
.