{"id":2469,"date":"2011-05-27T13:36:33","date_gmt":"2011-05-27T18:36:33","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=2469"},"modified":"2011-05-27T15:42:41","modified_gmt":"2011-05-27T20:42:41","slug":"qizxopen","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=2469","title":{"rendered":"Qizx\/open"},"content":{"rendered":"<span id=\"Overview\"><h2>Overview<\/h2><\/span>\n<p>* Qizx\/open is the open source edition of <a href=\"http:\/\/www.xmlmind.com\/qizx\/\">Qizx<\/a><br \/>\n* It is an XQuery processor implementing:<br \/>\n&#8211; XQuery 1.0<br \/>\n&#8211; XQuery full-Text<br \/>\n&#8211; XQuery Update<br \/>\n&#8211; XQuery 1.1 update (most features)<br \/>\n&#8211; XQuery Scripting<\/p>\n<span id=\"Download_and_Install\"><h2>Download and Install<\/h2><\/span>\n<p>* Download qizxopen from its <a href=\"http:\/\/www.xmlmind.com\/qizxopen\/download.shtml\">download site<\/a>, e.g. <a href=\"http:\/\/www.xmlmind.net\/qizx\/_download\/qizxopen-4.1.zip\">qizxopen-4.1.zip<\/a><br \/>\n* Unzip onto a local directory, e.g. C:\\prog\\qizxopen-4.1<br \/>\n* See docs\\manual.pdf for details on how to install and use qizx\/open<\/p>\n<span id=\"Qizx_Studio\"><h2>Qizx Studio<\/h2><\/span>\n<p>* Start studio<\/p>\n<pre>\r\nC:\\prog\\qizxopen-4.1\\bin>qizxstudio.bat\r\n<\/pre>\n<span id=\"Qizx_Command_Line\"><h2>Qizx Command Line<\/h2><\/span>\n<p>* quizx <XQuery File><\/p>\n<pre>\r\nrem Include qizxopne in PATH\r\nc:\\set PATH=C:\\prog\\qizxopen-4.1\\bin;%PATH%\r\n\r\nrem Change to script directory\r\ncd C:\\prog\\qizxopen-4.1\\docs\\samples\\book_queries\r\n\r\nrem Modify 4.xg to use absolute file path\r\nrem declare variable $authors := collection(\"C:\/prog\/qizxopen-4.1\/docs\/samples\/book_data\/Authors\/*.xml\");\r\nrem declare variable $books := collection(\"C:\/prog\/qizxopen-4.1\/docs\/samples.\/book_data\/Books\/*.xml\");\r\n\r\nrem Run qizx command line\r\nquizx 4.xq\r\n<\/pre>\n<span id=\"Java_API\"><h2>Java API<\/h2><\/span>\n<span id=\"Sample_Eclipse_Project\"><h3>Sample Eclipse Project<\/h3><\/span>\n<p>* Create a new Eclipse project<br \/>\n* Include all qizxopen jar files located in &#8220;C:\\prog\\qizxopen-4.1\\lib&#8221; directory in the Elipse build directory<br \/>\n* Create a new sample xml file named books.xml in etc directory:<\/p>\n<pre lang=\"xml\">\r\n<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n<bookstore>\r\n<book category=\"COOKING\">\r\n  <title lang=\"en\">Everyday Italian<\/title>\r\n  <author>Giada De Laurentiis<\/author>\r\n  <year>2005<\/year>\r\n  <price>30.00<\/price>\r\n<\/book>\r\n<book category=\"CHILDREN\">\r\n  <title lang=\"en\">Harry Potter<\/title>\r\n  <author>J K. Rowling<\/author>\r\n  <year>2005<\/year>\r\n  <price>29.99<\/price>\r\n<\/book>\r\n<book category=\"WEB\">\r\n  <title lang=\"en\">XQuery Kick Start<\/title>\r\n  <author>James McGovern<\/author>\r\n  <author>Per Bothner<\/author>\r\n  <author>Kurt Cagle<\/author>\r\n  <author>James Linn<\/author>\r\n  <author>Vaidyanathan Nagarajan<\/author>\r\n  <year>2003<\/year>\r\n  <price>49.99<\/price>\r\n<\/book>\r\n<book category=\"WEB\">\r\n  <title lang=\"en\">Learning XML<\/title>\r\n  <author>Erik T. Ray<\/author>\r\n  <year>2003<\/year>\r\n  <price>39.95<\/price>\r\n<\/book>\r\n<\/bookstore>\r\n<\/pre>\n<p>* Create a sample XQuery file named books.xq in the etc directory:<\/p>\n<pre lang=\"java\">\r\nfor $x in doc(\"etc\/books.xml\")\/bookstore\/book\r\nwhere $x\/price>30\r\norder by $x\/title\r\nreturn $x\/title\r\n<\/pre>\n<p>* Use Qizx Java API in Java program:<\/p>\n<pre lang=\"java\">\r\nimport com.qizx.api.*;\r\nimport com.qizx.util.basic.*;\r\n...\r\n\r\npublic void testBooks1Xq() \r\nthrows CompilationException, \r\n       EvaluationException, \r\n       IOException {\r\n  this.doXQuery(\"books.xq\");\r\n}\r\n\r\nprivate void doXQuery(String scriptFile)\r\n  throws CompilationException, \r\n    EvaluationException, \r\n    IOException {\r\n  String userDirStr = System.getProperty(\"user.dir\");\r\n  String etcDirStr = userDirStr + \"\/etc\/\";\r\n  File etcDir = new File(etcDirStr);\r\n  System.out.println(etcDir);\r\n  XQuerySessionManager sm = new XQuerySessionManager(etcDir.toURL());\r\n\r\n  XQuerySession sess = sm.createSession();\r\n\r\n  Expression expr = sess.compileExpression(\r\n      FileUtil.loadString(etcDirStr + scriptFile));\r\n  ItemSequence results = expr.evaluate();\r\n  while (results.moveToNextItem()){\r\n    Item result = results.getCurrentItem();\r\n    System.out.println(result.getString());\r\n  }\r\n}\r\n<\/pre>\n<p>* Sample output:<\/p>\n<pre>\r\nLearning XML\r\nXQuery Kick Start\r\n<\/pre>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/www.xmlmind.com\/qizxopen\/\">QizxOpen<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview * Qizx\/open is the open source edition of Qizx * It is an XQuery processor implementing: &#8211; XQuery 1.0 &#8211; XQuery full-Text &#8211; XQuery Update &#8211; XQuery 1.1 update (most features) &#8211; XQuery Scripting Download and Install * Download &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=2469\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[99],"tags":[],"class_list":["post-2469","post","type-post","status-publish","format-standard","hentry","category-xquery"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s8cRUO-qizxopen","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2469"}],"version-history":[{"count":5,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2469\/revisions"}],"predecessor-version":[{"id":2496,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2469\/revisions\/2496"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}