开发者

How to validate XQuery source file for XSD schema

I mean without in开发者_运维知识库put XML file. I'm using Saxon-EE 9.2.


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:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜