如何检索相应的xpath [英] how to retrieve corresponding xpath

查看:138
本文介绍了如何检索相应的xpath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道如何在Eclipse中使用eclipse平台输入xml文件时如何检索相应的xpath。
$ b

 < document> 
< name> xml文件< / name>
< size> 12 kb< / size>
< / document>

结果是:

  / document 
/ document / name
/ document / size


解决方案

你可以通过firefox加上firebug这个功能:


  1. 打开在firefox中的xml,然后去firebug中的HTML视图,如果你需要XPath与命名空间,使用附加插件FireXPath

  2. 右键点击你想要XPath的xml-Element XPath复制

  3. 在Eclipse中,您可以使用插件评估XPath https://github.com/stoupa91/eclipse-xpath-evaluation-plugin Java EE版本的eclipse的XPath视图


I would like to know about how to retrieve corresponding xpaths when we input an xml file in java with eclipse platform.

For example,

<document>
<name>xml file</name>
<size>12 kb</size>
</document>   

the result is:

/document
/document/name
/document/size

解决方案

You can have this feature over firefox with the plugin firebug:

  1. Open the xml in the firefox and then go to HTML View in the firebug, if you need the XPath with Namespaces use the Additional Plugin FireXPath
  2. Right Click the xml-Element you want the XPath from and make XPath Copy
  3. In Eclipse you can evaluate the XPath with the Plugin https://github.com/stoupa91/eclipse-xpath-evaluation-plugin the XPath View which comes with the Java EE Version of eclipse

这篇关于如何检索相应的xpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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