如何从xsd生成xpath? [英] How to generate xpath from xsd?

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

问题描述

如何从xsd生成xpath? XSD验证xml。我正在一个项目中工作,我使用java从xsd生成示例XML,然后从该XML生成xpath。如果有任何方法可以直接从xsd生成xpath,请告诉我。

How can I generate xpath from an xsd? XSD validates an xml. I am working in a project where I am generating a sample XML from the xsd using java and then generating xpath from that XML. If there is any way to generate xpath directly from xsd please let me know.

推荐答案

此类工具存在许多问题:

There are a number of problems with such tools:

很少生成的XPath表达式很好。没有这样的工具会产生超出位置信息的有意义的谓词。

The XPath expression generated rarely is a good one. No such tool will produce meaningful predicates beyond position information.

没有工具(据我所知)会产生一个XPath表达式,它精确地选择一组选定的节点。

There is no tool (to my knowledge) that would generate an XPath expression that selects exactly a set of selected nodes.

除此之外,在不学习XPath的情况下使用这些工具真的很有害 - 它们支持无知。

Apart from this, such tools used without learning XPath are really harmful -- they support ignorance.

I会建议使用书籍和其他资源(例如以下内容)认真学习XPath。

I would recommend serious learning of XPath using books and other resources such as following.

https://stackoverflow.com/questions/339930/any-good-xslt-tutorial-book-blog-site-online/341589#341589

有关详细信息,请参阅以下答案..

See the following answer for more information..

是否有针对xPath选择器的在线测试人员?

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

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