如何验证 XSD 架构的 XQuery 源文件

发布于 2024-08-22 22:41:03 字数 44 浏览 3 评论 0原文

我的意思是没有输入 XML 文件。 我正在使用 Saxon-EE 9.2。

I mean without input XML file.
I'm using Saxon-EE 9.2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

临风闻羌笛 2024-08-29 22:41:03

如果您想验证 Xquery 源文件,我知道的唯一途径就是首先将其转换为 XqueryX 使用 xq2xqx.xsl 然后使用 xsd基于此的架构

if you mean to validate the Xquery source file then, the only route I know of is to first convert it to XqueryX using xq2xqx.xsl and then use a xsd schema based on that

残龙傲雪 2024-08-29 22:41:03

XQuery 源文件不是 XML 文档,因此无法使用 XML 模式进行验证。如果确实需要,可以使用 xq2xqx 库将 XQuery 源文件转换为 XQueryX 文档:

http://monet.nag.co.uk/xq2xml/

那里的代码需要一些整理,XQuery 解析器链接在

http://www.w3.org/2005/qt-applets/xgrammar.zip

和 Saxon jar - 这里免费的应该可以使用:

http://saxon.sourceforge.net/#F9.4HE

你最终应该得到命令行类似于:

java -cp "saxon9.jar;xquery.jar;trans2.jar" net.sf.saxon.Transform -it:main -o:"xq2xqx.log" -xsl:"xq2xqx. xsl" dump="no$2" xq=test.xquery

将生成 test.xqueryx,然后您可以根据官方 w3.org 架构验证文档:

http://www.w3.org/2005/XQueryX/xqueryx.xsd

An XQuery source file isn't an XML document, so can't be validated with an XML schema. If you really need to, you can use the xq2xqx library to convert XQuery source files into XQueryX documents:

http://monet.nag.co.uk/xq2xml/

The code there needs some tidying up, the XQuery parser linked at

http://www.w3.org/2005/qt-applets/xgrammar.zip

and the Saxon jar - the free one here should work:

http://saxon.sourceforge.net/#F9.4HE

You should end up with a command line something like:

java -cp "saxon9.jar;xquery.jar;trans2.jar" net.sf.saxon.Transform -it:main -o:"xq2xqx.log" -xsl:"xq2xqx.xsl" dump="no$2" xq=test.xquery

which will generate test.xqueryx, and you can then validate the document against the official w3.org schema:

http://www.w3.org/2005/XQueryX/xqueryx.xsd

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文