for $x at $i in doc(\"books.xml\")\/bookstore\/book\/title\r\nreturn <book>{$i}. {data($x)}<\/book><\/pre>\n\u7ed3\u679c\uff1a<\/p>\n
<book>1. Everyday Italian<\/book>\r\n<book>2. Harry Potter<\/book>\r\n<book>3. XQuery Kick Start<\/book>\r\n<book>4. Learning XML<\/book><\/pre>\n\u5728 for \u8bed\u53e5\u4e2d\u540c\u6837\u5141\u8bb8\u591a\u4e2a in \u8868\u8fbe\u5f0f\u3002\u8bf7\u4f7f\u7528\u9017\u53f7\u6765\u5206\u5272\u6bcf\u4e00\u4e2a in \u8868\u8fbe\u5f0f\uff1a<\/p>\n
for $x in (10,20), $y in (100,200)\r\nreturn <test>x={$x} and y={$y}<\/test><\/pre>\n\u7ed3\u679c\uff1a<\/p>\n
<test>x=10 and y=100<\/test>\r\n<test>x=10 and y=200<\/test>\r\n<test>x=20 and y=100<\/test>\r\n<test>x=20 and y=200<\/test><\/pre>\nlet \u8bed\u53e5<\/strong><\/div>\nlet \u8bed\u53e5\u53ef\u5b8c\u6210\u53d8\u91cf\u5206\u914d\uff0c\u5e76\u53ef\u907f\u514d\u591a\u6b21\u91cd\u590d\u76f8\u540c\u7684\u8868\u8fbe\u5f0f\u3002let \u8bed\u53e5\u4e0d\u4f1a\u5bfc\u81f4\u8fed\u4ee3\u3002<\/p>\n
let $x := (1 to 5)\r\nreturn <test>{$x}<\/test><\/pre>\n\u7ed3\u679c\uff1a<\/p>\n
<test>1 2 3 4 5<\/test><\/pre>\nwhere \u8bed\u53e5<\/strong><\/div>\nwhere \u8bed\u53e5\u7528\u4e8e\u4e3a\u7ed3\u679c\u8bbe\u5b9a\u4e00\u4e2a\u6216\u591a\u4e2a\u6761\u4ef6\uff08criteria\uff09\u3002<\/p>\n
where $x\/price>30 and $x\/price<100<\/pre>\norder by \u8bed\u53e5<\/strong><\/div>\norder by \u8bed\u53e5\u7528\u4e8e\u89c4\u5b9a\u7ed3\u679c\u7684\u6392\u5e8f\u6b21\u5e8f\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u8981\u6839\u636e category \u548c title \u6765\u5bf9\u7ed3\u679c\u8fdb\u884c\u6392\u5e8f\uff1a<\/p>\n
for $x in doc(\"books.xml\")\/bookstore\/book\r\norder by $x\/@category, $x\/title\r\nreturn $x\/title<\/pre>\n\u7ed3\u679c\uff1a<\/p>\n
<title lang=\"en\">Harry Potter<\/title>\r\n<title lang=\"en\">Everyday Italian<\/title>\r\n<title lang=\"en\">Learning XML<\/title>\r\n<title lang=\"en\">XQuery Kick Start<\/title><\/pre>\nreturn \u8bed\u53e5\uff1a<\/strong><\/div>\nreturn \u8bed\u53e5\u89c4\u5b9a\u8981\u8fd4\u56de\u7684\u5185\u5bb9\u3002<\/p>\n
for $x in doc(\"books.xml\")\/bookstore\/book\r\nreturn $x\/title<\/pre>\n\u7ed3\u679c\uff1a<\/p>\n
<title lang=\"en\">Everyday Italian<\/title>\r\n<title lang=\"en\">Harry Potter<\/title>\r\n<title lang=\"en\">XQuery Kick Start<\/title>\r\n<title lang=\"en\">Learning XML<\/title><\/pre>\n","protected":false},"excerpt":{"rendered":"\u6b63\u5982\u5728\u524d\u9762\u7684\u7ae0\u8282\u6240\u770b\u5230\u7684\uff0c\u6211\u4eec\u4f7f\u7528\u8def\u5f84\u8868\u8fbe\u5f0f\u6216 FLWOR \u8868\u8fbe\u5f0f\u6765\u9009\u53d6\u548c\u8fc7\u6ee4\u5143\u7d20\u3002 \u8bf7\u770b\u4e0b\u9762\u7684 FLWOR […]<\/p>\n","protected":false},"author":321,"featured_media":194844,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-194852","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/194852","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/321"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=194852"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/194852\/revisions"}],"predecessor-version":[{"id":194857,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/194852\/revisions\/194857"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/194844"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=194852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=194852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=194852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}