XPath感知XML模板或内容辅助 [英] XPath aware XML templates or content assist

查看:56
本文介绍了XPath感知XML模板或内容辅助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个自定义XML编辑器,该编辑器可以基于当前XPath提供模板或内容帮助.使用扩展点 org.eclipse.ui.editors.templates 创建模板,使其可用于整个上下文类型,这有点太简单了.

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.

使用Google搜索时,我会链接到可以处理的 oXygen 这个,即:

When googling I get links to oXygen who can handle this, i.e:

...了解XPath的内容助手,其中显示了功能和轴(全部记录在W3C规范的章节中),变量和参数以及上下文中元素和属性的名称测试.

我猜我需要使用WTP XML编辑器吗?

I am guessing i'll need to use the WTP XML editor?

推荐答案

可以.调用WTP XML编辑器对 org.eclipse.wst.sse.ui.completionProposal 扩展点的贡献时,它们将查找相关的DOM节点和文本位置,并找出建议的内容.贡献更多的计算机"没有人为的限制.您可以使用 org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#computeCompletionProposals(CompletionProposalInvocationContext,IProgressMonitor)或从XML内容辅助模板中查看如何针对XML Schema语法的DTD进行操作使用 org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer#computeCompletionProposals(CompletionProposalInvocationContext,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 using org.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 using org.eclipse.wst.xml.ui.internal.contentassist.XMLTemplatesCompletionProposalComputer#computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor).

这篇关于XPath感知XML模板或内容辅助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆