How to generate xpath from xsd?(如何从 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.
我建议通过以下书籍和其他资源认真学习 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从 xsd 生成 xpath?


- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01