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
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:
发布评论
评论(2)
如果您想验证 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
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