xq-lsp 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +119 -12
  3. package/builtins/builtins-array.xq +34 -9
  4. package/builtins/builtins-fn.xq +492 -101
  5. package/builtins/builtins-map.xq +6 -2
  6. package/builtins/builtins-math.xq +1 -1
  7. package/builtins/builtins-xs.xq +63 -0
  8. package/demo/index.html +151 -0
  9. package/demo/main.ts +307 -0
  10. package/demo/package-lock.json +1301 -0
  11. package/demo/package.json +20 -0
  12. package/demo/vite.config.ts +15 -0
  13. package/dist/analyzer.d.ts +28 -0
  14. package/dist/analyzer.js +128 -40
  15. package/dist/ast-nodes.d.ts +90 -0
  16. package/dist/ast-nodes.js +305 -0
  17. package/dist/builtins.js +3 -0
  18. package/dist/completion-core.d.ts +17 -0
  19. package/dist/completion-core.js +113 -0
  20. package/dist/completion.d.ts +3 -8
  21. package/dist/completion.js +10 -150
  22. package/dist/config.d.ts +13 -0
  23. package/dist/config.js +81 -0
  24. package/dist/context-item-diagnostics.d.ts +19 -0
  25. package/dist/context-item-diagnostics.js +133 -0
  26. package/dist/definition.d.ts +4 -0
  27. package/dist/definition.js +67 -0
  28. package/dist/features.d.ts +1 -2
  29. package/dist/features.js +81 -112
  30. package/dist/functioncall-diagnostics.d.ts +12 -0
  31. package/dist/functioncall-diagnostics.js +87 -0
  32. package/dist/hover-core.d.ts +39 -0
  33. package/dist/hover-core.js +87 -0
  34. package/dist/namespace-diagnostics.d.ts +33 -0
  35. package/dist/namespace-diagnostics.js +108 -0
  36. package/dist/qt4-worker.d.ts +18 -0
  37. package/dist/qt4-worker.js +46 -0
  38. package/dist/runtimes.d.ts +2 -0
  39. package/dist/runtimes.js +67 -0
  40. package/dist/server.js +254 -50
  41. package/dist/test-utils.d.ts +3 -0
  42. package/dist/test-utils.js +16 -0
  43. package/dist/typechecker.d.ts +7 -0
  44. package/dist/typechecker.js +388 -0
  45. package/dist/types.d.ts +30 -6
  46. package/dist/types.js +6 -0
  47. package/dist/unused-diagnostics.d.ts +19 -0
  48. package/dist/unused-diagnostics.js +202 -0
  49. package/firebase.json +12 -0
  50. package/package.json +31 -27
  51. package/release-please-config.json +16 -0
  52. package/scripts/generate-existdb.ts +890 -0
  53. package/src/analyzer.test.ts +163 -0
  54. package/src/analyzer.ts +139 -41
  55. package/src/ast-nodes.ts +348 -0
  56. package/src/builtins.test.ts +32 -0
  57. package/src/builtins.ts +3 -0
  58. package/src/completion-core.ts +139 -0
  59. package/src/completion.test.ts +152 -0
  60. package/src/completion.ts +11 -173
  61. package/src/config.ts +90 -0
  62. package/src/context-item-diagnostics.test.ts +182 -0
  63. package/src/context-item-diagnostics.ts +143 -0
  64. package/src/definition.ts +82 -0
  65. package/src/features.test.ts +110 -0
  66. package/src/features.ts +87 -128
  67. package/src/functioncall-diagnostics.test.ts +169 -0
  68. package/src/functioncall-diagnostics.ts +110 -0
  69. package/src/hover-core.ts +114 -0
  70. package/src/lsp-config.test.ts +183 -0
  71. package/src/namespace-diagnostics.test.ts +162 -0
  72. package/src/namespace-diagnostics.ts +133 -0
  73. package/src/qt4-diagnostic.test.ts +271 -0
  74. package/src/qt4-snaps/app-CatalogCheck.snap +1 -0
  75. package/src/qt4-snaps/app-Demos.snap +18 -0
  76. package/src/qt4-snaps/app-Duplicates.snap +1 -0
  77. package/src/qt4-snaps/app-FunctxFn.snap +162 -0
  78. package/src/qt4-snaps/app-FunctxFunctx.snap +714 -0
  79. package/src/qt4-snaps/app-UseCaseCompoundValues.snap +1 -0
  80. package/src/qt4-snaps/app-UseCaseJSON.snap +1 -0
  81. package/src/qt4-snaps/app-UseCaseNLP.snap +1 -0
  82. package/src/qt4-snaps/app-UseCaseNS.snap +1 -0
  83. package/src/qt4-snaps/app-UseCaseR.snap +1 -0
  84. package/src/qt4-snaps/app-UseCaseR31.snap +1 -0
  85. package/src/qt4-snaps/app-UseCaseSEQ.snap +1 -0
  86. package/src/qt4-snaps/app-UseCaseSGML.snap +1 -0
  87. package/src/qt4-snaps/app-UseCaseSTRING.snap +1 -0
  88. package/src/qt4-snaps/app-UseCaseTREE.snap +1 -0
  89. package/src/qt4-snaps/app-UseCaseXMP.snap +1 -0
  90. package/src/qt4-snaps/app-Walmsley.snap +1 -0
  91. package/src/qt4-snaps/app-XMark.snap +10 -0
  92. package/src/qt4-snaps/array-append.snap +1 -0
  93. package/src/qt4-snaps/array-filter.snap +10 -0
  94. package/src/qt4-snaps/array-flatten.snap +1 -0
  95. package/src/qt4-snaps/array-fold-left.snap +1 -0
  96. package/src/qt4-snaps/array-fold-right.snap +1 -0
  97. package/src/qt4-snaps/array-for-each-pair.snap +1 -0
  98. package/src/qt4-snaps/array-for-each.snap +1 -0
  99. package/src/qt4-snaps/array-get.snap +1 -0
  100. package/src/qt4-snaps/array-head.snap +1 -0
  101. package/src/qt4-snaps/array-insert-before.snap +1 -0
  102. package/src/qt4-snaps/array-join.snap +1 -0
  103. package/src/qt4-snaps/array-put.snap +1 -0
  104. package/src/qt4-snaps/array-remove.snap +1 -0
  105. package/src/qt4-snaps/array-reverse.snap +1 -0
  106. package/src/qt4-snaps/array-size.snap +1 -0
  107. package/src/qt4-snaps/array-sort.snap +1 -0
  108. package/src/qt4-snaps/array-subarray.snap +1 -0
  109. package/src/qt4-snaps/array-tail.snap +1 -0
  110. package/src/qt4-snaps/bin-and.snap +1 -0
  111. package/src/qt4-snaps/bin-bin.snap +1 -0
  112. package/src/qt4-snaps/bin-decode-string.snap +1 -0
  113. package/src/qt4-snaps/bin-encode-string.snap +1 -0
  114. package/src/qt4-snaps/bin-find.snap +1 -0
  115. package/src/qt4-snaps/bin-from-octets.snap +1 -0
  116. package/src/qt4-snaps/bin-hex.snap +1 -0
  117. package/src/qt4-snaps/bin-insert-before.snap +1 -0
  118. package/src/qt4-snaps/bin-join.snap +1 -0
  119. package/src/qt4-snaps/bin-length.snap +1 -0
  120. package/src/qt4-snaps/bin-not.snap +1 -0
  121. package/src/qt4-snaps/bin-octal.snap +1 -0
  122. package/src/qt4-snaps/bin-or.snap +1 -0
  123. package/src/qt4-snaps/bin-pack-double.snap +1 -0
  124. package/src/qt4-snaps/bin-pack-float.snap +1 -0
  125. package/src/qt4-snaps/bin-pack-integer.snap +1 -0
  126. package/src/qt4-snaps/bin-pad-left.snap +1 -0
  127. package/src/qt4-snaps/bin-pad-right.snap +1 -0
  128. package/src/qt4-snaps/bin-part.snap +1 -0
  129. package/src/qt4-snaps/bin-shift.snap +1 -0
  130. package/src/qt4-snaps/bin-to-octets.snap +1 -0
  131. package/src/qt4-snaps/bin-unpack-double.snap +1 -0
  132. package/src/qt4-snaps/bin-unpack-float.snap +1 -0
  133. package/src/qt4-snaps/bin-unpack-integer.snap +1 -0
  134. package/src/qt4-snaps/bin-unpack-unsigned-integer.snap +1 -0
  135. package/src/qt4-snaps/bin-xor.snap +1 -0
  136. package/src/qt4-snaps/file-file.snap +1 -0
  137. package/src/qt4-snaps/fn-QName.snap +1 -0
  138. package/src/qt4-snaps/fn-abs.snap +1 -0
  139. package/src/qt4-snaps/fn-adjust-date-to-timezone.snap +1 -0
  140. package/src/qt4-snaps/fn-adjust-dateTime-to-timezone.snap +1 -0
  141. package/src/qt4-snaps/fn-adjust-time-to-timezone.snap +1 -0
  142. package/src/qt4-snaps/fn-analyze-string.snap +1 -0
  143. package/src/qt4-snaps/fn-apply.snap +1 -0
  144. package/src/qt4-snaps/fn-available-environment-variables.snap +1 -0
  145. package/src/qt4-snaps/fn-avg.snap +1 -0
  146. package/src/qt4-snaps/fn-base-uri.snap +1 -0
  147. package/src/qt4-snaps/fn-boolean.snap +1 -0
  148. package/src/qt4-snaps/fn-ceiling.snap +1 -0
  149. package/src/qt4-snaps/fn-codepoint-equal.snap +1 -0
  150. package/src/qt4-snaps/fn-codepoints-to-string.snap +1 -0
  151. package/src/qt4-snaps/fn-collation-key.snap +1 -0
  152. package/src/qt4-snaps/fn-collection.snap +1 -0
  153. package/src/qt4-snaps/fn-compare.snap +1 -0
  154. package/src/qt4-snaps/fn-concat.snap +1 -0
  155. package/src/qt4-snaps/fn-contains-token.snap +1 -0
  156. package/src/qt4-snaps/fn-contains.snap +1 -0
  157. package/src/qt4-snaps/fn-count.snap +1 -0
  158. package/src/qt4-snaps/fn-current-date.snap +1 -0
  159. package/src/qt4-snaps/fn-current-dateTime.snap +1 -0
  160. package/src/qt4-snaps/fn-current-time.snap +1 -0
  161. package/src/qt4-snaps/fn-data.snap +8 -0
  162. package/src/qt4-snaps/fn-dateTime.snap +1 -0
  163. package/src/qt4-snaps/fn-day-from-date.snap +1 -0
  164. package/src/qt4-snaps/fn-day-from-dateTime.snap +1 -0
  165. package/src/qt4-snaps/fn-days-from-duration.snap +1 -0
  166. package/src/qt4-snaps/fn-deep-equal.snap +1 -0
  167. package/src/qt4-snaps/fn-default-collation.snap +1 -0
  168. package/src/qt4-snaps/fn-default-language.snap +1 -0
  169. package/src/qt4-snaps/fn-distinct-values.snap +1 -0
  170. package/src/qt4-snaps/fn-doc-available.snap +1 -0
  171. package/src/qt4-snaps/fn-doc.snap +1 -0
  172. package/src/qt4-snaps/fn-document-uri.snap +8 -0
  173. package/src/qt4-snaps/fn-element-with-id.snap +1 -0
  174. package/src/qt4-snaps/fn-empty.snap +1 -0
  175. package/src/qt4-snaps/fn-encode-for-uri.snap +1 -0
  176. package/src/qt4-snaps/fn-ends-with.snap +1 -0
  177. package/src/qt4-snaps/fn-environment-variable.snap +1 -0
  178. package/src/qt4-snaps/fn-error.snap +128 -0
  179. package/src/qt4-snaps/fn-escape-html-uri.snap +1 -0
  180. package/src/qt4-snaps/fn-exactly-one.snap +1 -0
  181. package/src/qt4-snaps/fn-exists.snap +1 -0
  182. package/src/qt4-snaps/fn-false.snap +1 -0
  183. package/src/qt4-snaps/fn-filter.snap +10 -0
  184. package/src/qt4-snaps/fn-floor.snap +1 -0
  185. package/src/qt4-snaps/fn-fold-left.snap +1 -0
  186. package/src/qt4-snaps/fn-fold-right.snap +1 -0
  187. package/src/qt4-snaps/fn-for-each-pair.snap +10 -0
  188. package/src/qt4-snaps/fn-for-each.snap +10 -0
  189. package/src/qt4-snaps/fn-format-date.snap +26 -0
  190. package/src/qt4-snaps/fn-format-dateTime.snap +1 -0
  191. package/src/qt4-snaps/fn-format-integer.snap +1 -0
  192. package/src/qt4-snaps/fn-format-number.snap +38 -0
  193. package/src/qt4-snaps/fn-format-time.snap +1 -0
  194. package/src/qt4-snaps/fn-function-arity.snap +1 -0
  195. package/src/qt4-snaps/fn-function-lookup.snap +1 -0
  196. package/src/qt4-snaps/fn-function-name.snap +1 -0
  197. package/src/qt4-snaps/fn-generate-id.snap +18 -0
  198. package/src/qt4-snaps/fn-has-children.snap +26 -0
  199. package/src/qt4-snaps/fn-head.snap +1 -0
  200. package/src/qt4-snaps/fn-hours-from-dateTime.snap +1 -0
  201. package/src/qt4-snaps/fn-hours-from-duration.snap +1 -0
  202. package/src/qt4-snaps/fn-hours-from-time.snap +1 -0
  203. package/src/qt4-snaps/fn-id.snap +10 -0
  204. package/src/qt4-snaps/fn-idref.snap +10 -0
  205. package/src/qt4-snaps/fn-implicit-timezone.snap +1 -0
  206. package/src/qt4-snaps/fn-in-scope-prefixes.snap +26 -0
  207. package/src/qt4-snaps/fn-index-of.snap +1 -0
  208. package/src/qt4-snaps/fn-innermost.snap +58 -0
  209. package/src/qt4-snaps/fn-insert-before.snap +1 -0
  210. package/src/qt4-snaps/fn-iri-to-uri.snap +1 -0
  211. package/src/qt4-snaps/fn-json-doc.snap +1 -0
  212. package/src/qt4-snaps/fn-json-to-xml.snap +1 -0
  213. package/src/qt4-snaps/fn-lang.snap +10 -0
  214. package/src/qt4-snaps/fn-last.snap +1 -0
  215. package/src/qt4-snaps/fn-load-xquery-module.snap +1 -0
  216. package/src/qt4-snaps/fn-local-name-from-QName.snap +1 -0
  217. package/src/qt4-snaps/fn-local-name.snap +10 -0
  218. package/src/qt4-snaps/fn-lower-case.snap +1 -0
  219. package/src/qt4-snaps/fn-matches.re.snap +1 -0
  220. package/src/qt4-snaps/fn-matches.snap +1 -0
  221. package/src/qt4-snaps/fn-max.snap +1 -0
  222. package/src/qt4-snaps/fn-min.snap +1 -0
  223. package/src/qt4-snaps/fn-minutes-from-dateTime.snap +1 -0
  224. package/src/qt4-snaps/fn-minutes-from-duration.snap +1 -0
  225. package/src/qt4-snaps/fn-minutes-from-time.snap +1 -0
  226. package/src/qt4-snaps/fn-month-from-date.snap +1 -0
  227. package/src/qt4-snaps/fn-month-from-dateTime.snap +1 -0
  228. package/src/qt4-snaps/fn-months-from-duration.snap +1 -0
  229. package/src/qt4-snaps/fn-name.snap +10 -0
  230. package/src/qt4-snaps/fn-namespace-uri-for-prefix.snap +1 -0
  231. package/src/qt4-snaps/fn-namespace-uri-from-QName.snap +1 -0
  232. package/src/qt4-snaps/fn-namespace-uri.snap +1 -0
  233. package/src/qt4-snaps/fn-nilled.snap +16 -0
  234. package/src/qt4-snaps/fn-node-name.snap +32 -0
  235. package/src/qt4-snaps/fn-normalize-space.snap +1 -0
  236. package/src/qt4-snaps/fn-normalize-unicode.snap +26 -0
  237. package/src/qt4-snaps/fn-not.snap +1 -0
  238. package/src/qt4-snaps/fn-number.snap +1 -0
  239. package/src/qt4-snaps/fn-one-or-more.snap +1 -0
  240. package/src/qt4-snaps/fn-outermost.snap +58 -0
  241. package/src/qt4-snaps/fn-parse-ietf-date.snap +1 -0
  242. package/src/qt4-snaps/fn-parse-json.snap +1 -0
  243. package/src/qt4-snaps/fn-parse-xml-fragment.snap +1 -0
  244. package/src/qt4-snaps/fn-parse-xml.snap +1 -0
  245. package/src/qt4-snaps/fn-path.snap +26 -0
  246. package/src/qt4-snaps/fn-position.snap +1 -0
  247. package/src/qt4-snaps/fn-prefix-from-QName.snap +1 -0
  248. package/src/qt4-snaps/fn-random-number-generator.snap +1 -0
  249. package/src/qt4-snaps/fn-remove.snap +1 -0
  250. package/src/qt4-snaps/fn-replace.snap +330 -0
  251. package/src/qt4-snaps/fn-resolve-QName.snap +1 -0
  252. package/src/qt4-snaps/fn-resolve-uri.snap +1 -0
  253. package/src/qt4-snaps/fn-reverse.snap +1 -0
  254. package/src/qt4-snaps/fn-root.snap +10 -0
  255. package/src/qt4-snaps/fn-round-half-to-even.snap +1 -0
  256. package/src/qt4-snaps/fn-round.snap +8 -0
  257. package/src/qt4-snaps/fn-seconds-from-dateTime.snap +1 -0
  258. package/src/qt4-snaps/fn-seconds-from-duration.snap +1 -0
  259. package/src/qt4-snaps/fn-seconds-from-time.snap +1 -0
  260. package/src/qt4-snaps/fn-serialize.snap +50 -0
  261. package/src/qt4-snaps/fn-sort.snap +1 -0
  262. package/src/qt4-snaps/fn-starts-with.snap +1 -0
  263. package/src/qt4-snaps/fn-static-base-uri.snap +1 -0
  264. package/src/qt4-snaps/fn-string-join.snap +8 -0
  265. package/src/qt4-snaps/fn-string-length.snap +1 -0
  266. package/src/qt4-snaps/fn-string-to-codepoints.snap +1 -0
  267. package/src/qt4-snaps/fn-string.snap +10 -0
  268. package/src/qt4-snaps/fn-subsequence.snap +1 -0
  269. package/src/qt4-snaps/fn-substring-after.snap +1 -0
  270. package/src/qt4-snaps/fn-substring-before.snap +1 -0
  271. package/src/qt4-snaps/fn-substring.snap +1 -0
  272. package/src/qt4-snaps/fn-sum.snap +1 -0
  273. package/src/qt4-snaps/fn-tail.snap +1 -0
  274. package/src/qt4-snaps/fn-timezone-from-date.snap +1 -0
  275. package/src/qt4-snaps/fn-timezone-from-dateTime.snap +1 -0
  276. package/src/qt4-snaps/fn-timezone-from-time.snap +1 -0
  277. package/src/qt4-snaps/fn-tokenize.snap +16 -0
  278. package/src/qt4-snaps/fn-trace.snap +8 -0
  279. package/src/qt4-snaps/fn-transform.snap +1 -0
  280. package/src/qt4-snaps/fn-translate.snap +1 -0
  281. package/src/qt4-snaps/fn-true.snap +1 -0
  282. package/src/qt4-snaps/fn-unordered.snap +1 -0
  283. package/src/qt4-snaps/fn-unparsed-text-available.snap +1 -0
  284. package/src/qt4-snaps/fn-unparsed-text-lines.snap +1 -0
  285. package/src/qt4-snaps/fn-unparsed-text.snap +1 -0
  286. package/src/qt4-snaps/fn-upper-case.snap +1 -0
  287. package/src/qt4-snaps/fn-uri-collection.snap +1 -0
  288. package/src/qt4-snaps/fn-xml-to-json.snap +1 -0
  289. package/src/qt4-snaps/fn-year-from-date.snap +1 -0
  290. package/src/qt4-snaps/fn-year-from-dateTime.snap +1 -0
  291. package/src/qt4-snaps/fn-years-from-duration.snap +1 -0
  292. package/src/qt4-snaps/fn-zero-or-one.snap +1 -0
  293. package/src/qt4-snaps/map-contains.snap +1 -0
  294. package/src/qt4-snaps/map-entry.snap +1 -0
  295. package/src/qt4-snaps/map-find.snap +1 -0
  296. package/src/qt4-snaps/map-for-each.snap +1 -0
  297. package/src/qt4-snaps/map-get.snap +1 -0
  298. package/src/qt4-snaps/map-keys.snap +1 -0
  299. package/src/qt4-snaps/map-merge.snap +1 -0
  300. package/src/qt4-snaps/map-put.snap +1 -0
  301. package/src/qt4-snaps/map-remove.snap +1 -0
  302. package/src/qt4-snaps/map-size.snap +1 -0
  303. package/src/qt4-snaps/math-math-acos.snap +1 -0
  304. package/src/qt4-snaps/math-math-asin.snap +1 -0
  305. package/src/qt4-snaps/math-math-atan.snap +1 -0
  306. package/src/qt4-snaps/math-math-atan2.snap +1 -0
  307. package/src/qt4-snaps/math-math-cos.snap +1 -0
  308. package/src/qt4-snaps/math-math-exp.snap +1 -0
  309. package/src/qt4-snaps/math-math-exp10.snap +1 -0
  310. package/src/qt4-snaps/math-math-log.snap +1 -0
  311. package/src/qt4-snaps/math-math-log10.snap +1 -0
  312. package/src/qt4-snaps/math-math-pi.snap +1 -0
  313. package/src/qt4-snaps/math-math-pow.snap +1 -0
  314. package/src/qt4-snaps/math-math-sin.snap +1 -0
  315. package/src/qt4-snaps/math-math-sqrt.snap +1 -0
  316. package/src/qt4-snaps/math-math-tan.snap +1 -0
  317. package/src/qt4-snaps/misc-AnnexE.snap +1 -0
  318. package/src/qt4-snaps/misc-AppendixA4.snap +1 -0
  319. package/src/qt4-snaps/misc-CombinedErrorCodes.snap +350 -0
  320. package/src/qt4-snaps/misc-ErrorsAndOptimization.snap +1 -0
  321. package/src/qt4-snaps/misc-HigherOrderFunctions.snap +32 -0
  322. package/src/qt4-snaps/misc-JsonTestSuite.snap +1 -0
  323. package/src/qt4-snaps/misc-StaticContext.snap +8 -0
  324. package/src/qt4-snaps/misc-Surrogates.snap +34 -0
  325. package/src/qt4-snaps/misc-UCACollation.snap +1 -0
  326. package/src/qt4-snaps/misc-XMLEdition.snap +22 -0
  327. package/src/qt4-snaps/op-QName-equal.snap +1 -0
  328. package/src/qt4-snaps/op-add-dayTimeDuration-to-date.snap +1 -0
  329. package/src/qt4-snaps/op-add-dayTimeDuration-to-dateTime.snap +1 -0
  330. package/src/qt4-snaps/op-add-dayTimeDuration-to-time.snap +1 -0
  331. package/src/qt4-snaps/op-add-dayTimeDurations.snap +1 -0
  332. package/src/qt4-snaps/op-add-yearMonthDuration-to-date.snap +1 -0
  333. package/src/qt4-snaps/op-add-yearMonthDuration-to-dateTime.snap +1 -0
  334. package/src/qt4-snaps/op-add-yearMonthDurations.snap +1 -0
  335. package/src/qt4-snaps/op-anyURI-equal.snap +1 -0
  336. package/src/qt4-snaps/op-anyURI-greater-than.snap +1 -0
  337. package/src/qt4-snaps/op-anyURI-less-than.snap +1 -0
  338. package/src/qt4-snaps/op-bang.snap +1 -0
  339. package/src/qt4-snaps/op-base64Binary-equal.snap +1 -0
  340. package/src/qt4-snaps/op-base64Binary-greater-than.snap +1 -0
  341. package/src/qt4-snaps/op-base64Binary-less-than.snap +1 -0
  342. package/src/qt4-snaps/op-boolean-equal.snap +1 -0
  343. package/src/qt4-snaps/op-boolean-greater-than.snap +1 -0
  344. package/src/qt4-snaps/op-boolean-less-than.snap +1 -0
  345. package/src/qt4-snaps/op-concat.snap +1 -0
  346. package/src/qt4-snaps/op-concatenate.snap +1 -0
  347. package/src/qt4-snaps/op-date-equal.snap +1 -0
  348. package/src/qt4-snaps/op-date-greater-than.snap +1 -0
  349. package/src/qt4-snaps/op-date-less-than.snap +1 -0
  350. package/src/qt4-snaps/op-dateTime-equal.snap +1 -0
  351. package/src/qt4-snaps/op-dateTime-greater-than.snap +1 -0
  352. package/src/qt4-snaps/op-dateTime-less-than.snap +1 -0
  353. package/src/qt4-snaps/op-dayTimeDuration-greater-than.snap +1 -0
  354. package/src/qt4-snaps/op-dayTimeDuration-less-than.snap +1 -0
  355. package/src/qt4-snaps/op-divide-dayTimeDuration-by-dayTimeDuration.snap +1 -0
  356. package/src/qt4-snaps/op-divide-dayTimeDuration.snap +1 -0
  357. package/src/qt4-snaps/op-divide-yearMonthDuration-by-yearMonthDuration.snap +1 -0
  358. package/src/qt4-snaps/op-divide-yearMonthDuration.snap +1 -0
  359. package/src/qt4-snaps/op-duration-equal.snap +1 -0
  360. package/src/qt4-snaps/op-except.snap +1 -0
  361. package/src/qt4-snaps/op-gDay-equal.snap +1 -0
  362. package/src/qt4-snaps/op-gMonth-equal.snap +1 -0
  363. package/src/qt4-snaps/op-gMonthDay-equal.snap +1 -0
  364. package/src/qt4-snaps/op-gYear-equal.snap +1 -0
  365. package/src/qt4-snaps/op-gYearMonth-equal.snap +1 -0
  366. package/src/qt4-snaps/op-hexBinary-equal.snap +1 -0
  367. package/src/qt4-snaps/op-hexBinary-greater-than.snap +1 -0
  368. package/src/qt4-snaps/op-hexBinary-less-than.snap +1 -0
  369. package/src/qt4-snaps/op-intersect.snap +1 -0
  370. package/src/qt4-snaps/op-is-same-node.snap +1 -0
  371. package/src/qt4-snaps/op-multiply-dayTimeDuration.snap +1 -0
  372. package/src/qt4-snaps/op-multiply-yearMonthDuration.snap +1 -0
  373. package/src/qt4-snaps/op-node-after.snap +1 -0
  374. package/src/qt4-snaps/op-node-before.snap +1 -0
  375. package/src/qt4-snaps/op-numeric-add.snap +1 -0
  376. package/src/qt4-snaps/op-numeric-divide.snap +1 -0
  377. package/src/qt4-snaps/op-numeric-equal.snap +1 -0
  378. package/src/qt4-snaps/op-numeric-greater-than.snap +1 -0
  379. package/src/qt4-snaps/op-numeric-integer-divide.snap +1 -0
  380. package/src/qt4-snaps/op-numeric-less-than.snap +1 -0
  381. package/src/qt4-snaps/op-numeric-mod.snap +1 -0
  382. package/src/qt4-snaps/op-numeric-multiply.snap +1 -0
  383. package/src/qt4-snaps/op-numeric-subtract.snap +1 -0
  384. package/src/qt4-snaps/op-numeric-unary-minus.snap +1 -0
  385. package/src/qt4-snaps/op-numeric-unary-plus.snap +1 -0
  386. package/src/qt4-snaps/op-same-key.snap +1 -0
  387. package/src/qt4-snaps/op-string-equal.snap +1 -0
  388. package/src/qt4-snaps/op-string-greater-than.snap +1 -0
  389. package/src/qt4-snaps/op-string-less-than.snap +1 -0
  390. package/src/qt4-snaps/op-subtract-dateTimes.snap +1 -0
  391. package/src/qt4-snaps/op-subtract-dates.snap +1 -0
  392. package/src/qt4-snaps/op-subtract-dayTimeDuration-from-date.snap +1 -0
  393. package/src/qt4-snaps/op-subtract-dayTimeDuration-from-dateTime.snap +1 -0
  394. package/src/qt4-snaps/op-subtract-dayTimeDuration-from-time.snap +1 -0
  395. package/src/qt4-snaps/op-subtract-dayTimeDurations.snap +1 -0
  396. package/src/qt4-snaps/op-subtract-times.snap +1 -0
  397. package/src/qt4-snaps/op-subtract-yearMonthDuration-from-date.snap +1 -0
  398. package/src/qt4-snaps/op-subtract-yearMonthDuration-from-dateTime.snap +1 -0
  399. package/src/qt4-snaps/op-subtract-yearMonthDurations.snap +1 -0
  400. package/src/qt4-snaps/op-time-equal.snap +1 -0
  401. package/src/qt4-snaps/op-time-greater-than.snap +1 -0
  402. package/src/qt4-snaps/op-time-less-than.snap +1 -0
  403. package/src/qt4-snaps/op-to.snap +1 -0
  404. package/src/qt4-snaps/op-union.snap +1 -0
  405. package/src/qt4-snaps/op-yearMonthDuration-greater-than.snap +1 -0
  406. package/src/qt4-snaps/op-yearMonthDuration-less-than.snap +1 -0
  407. package/src/qt4-snaps/prod-AllowingEmpty.snap +1 -0
  408. package/src/qt4-snaps/prod-Annotation.snap +146 -0
  409. package/src/qt4-snaps/prod-ArrayType.snap +1 -0
  410. package/src/qt4-snaps/prod-ArrowExpr.snap +1 -0
  411. package/src/qt4-snaps/prod-AxisStep.abbr.snap +1 -0
  412. package/src/qt4-snaps/prod-AxisStep.ancestor-or-self.snap +1 -0
  413. package/src/qt4-snaps/prod-AxisStep.ancestor.snap +1 -0
  414. package/src/qt4-snaps/prod-AxisStep.following-sibling.snap +1 -0
  415. package/src/qt4-snaps/prod-AxisStep.following.snap +1 -0
  416. package/src/qt4-snaps/prod-AxisStep.preceding-sibling.snap +1 -0
  417. package/src/qt4-snaps/prod-AxisStep.preceding.snap +1 -0
  418. package/src/qt4-snaps/prod-AxisStep.snap +114 -0
  419. package/src/qt4-snaps/prod-AxisStep.unabbr.snap +1 -0
  420. package/src/qt4-snaps/prod-BaseURIDecl.snap +20 -0
  421. package/src/qt4-snaps/prod-BoundarySpaceDecl.snap +14 -0
  422. package/src/qt4-snaps/prod-CastExpr.derived.snap +1 -0
  423. package/src/qt4-snaps/prod-CastExpr.snap +218 -0
  424. package/src/qt4-snaps/prod-CastableExpr.snap +56 -0
  425. package/src/qt4-snaps/prod-Comment.snap +1 -0
  426. package/src/qt4-snaps/prod-CompAttrConstructor.snap +14 -0
  427. package/src/qt4-snaps/prod-CompCommentConstructor.snap +8 -0
  428. package/src/qt4-snaps/prod-CompDocConstructor.snap +1 -0
  429. package/src/qt4-snaps/prod-CompElemConstructor.snap +1 -0
  430. package/src/qt4-snaps/prod-CompNamespaceConstructor.snap +1 -0
  431. package/src/qt4-snaps/prod-CompPIConstructor.snap +1 -0
  432. package/src/qt4-snaps/prod-CompTextConstructor.snap +8 -0
  433. package/src/qt4-snaps/prod-ConstructionDecl.snap +14 -0
  434. package/src/qt4-snaps/prod-ContextItemDecl.snap +20 -0
  435. package/src/qt4-snaps/prod-ContextItemExpr.snap +1 -0
  436. package/src/qt4-snaps/prod-CopyNamespacesDecl.snap +14 -0
  437. package/src/qt4-snaps/prod-CountClause.snap +1 -0
  438. package/src/qt4-snaps/prod-CurlyArrayConstructor.snap +1 -0
  439. package/src/qt4-snaps/prod-DecimalFormatDecl.snap +92 -0
  440. package/src/qt4-snaps/prod-DefaultCollationDecl.snap +32 -0
  441. package/src/qt4-snaps/prod-DefaultNamespaceDecl.snap +92 -0
  442. package/src/qt4-snaps/prod-DirAttributeList.snap +58 -0
  443. package/src/qt4-snaps/prod-DirElemConstructor.snap +62 -0
  444. package/src/qt4-snaps/prod-DirElemContent.namespace.snap +176 -0
  445. package/src/qt4-snaps/prod-DirElemContent.snap +14 -0
  446. package/src/qt4-snaps/prod-DirElemContent.whitespace.snap +178 -0
  447. package/src/qt4-snaps/prod-DirectConstructor.snap +56 -0
  448. package/src/qt4-snaps/prod-EQName.snap +48 -0
  449. package/src/qt4-snaps/prod-EmptyOrderDecl.snap +14 -0
  450. package/src/qt4-snaps/prod-ExtensionExpr.snap +50 -0
  451. package/src/qt4-snaps/prod-ForClause.snap +158 -0
  452. package/src/qt4-snaps/prod-FunctionCall.snap +102 -0
  453. package/src/qt4-snaps/prod-FunctionDecl.snap +256 -0
  454. package/src/qt4-snaps/prod-GeneralComp.eq.snap +1 -0
  455. package/src/qt4-snaps/prod-GeneralComp.ge.snap +1 -0
  456. package/src/qt4-snaps/prod-GeneralComp.gt.snap +1 -0
  457. package/src/qt4-snaps/prod-GeneralComp.le.snap +1 -0
  458. package/src/qt4-snaps/prod-GeneralComp.lt.snap +1 -0
  459. package/src/qt4-snaps/prod-GeneralComp.ne.snap +1 -0
  460. package/src/qt4-snaps/prod-GroupByClause.snap +8 -0
  461. package/src/qt4-snaps/prod-IfExpr.snap +1 -0
  462. package/src/qt4-snaps/prod-InlineFunctionExpr.snap +14 -0
  463. package/src/qt4-snaps/prod-InstanceofExpr.snap +38 -0
  464. package/src/qt4-snaps/prod-LetClause.snap +40 -0
  465. package/src/qt4-snaps/prod-Literal.snap +68 -0
  466. package/src/qt4-snaps/prod-Lookup.snap +1 -0
  467. package/src/qt4-snaps/prod-MapConstructor.snap +1 -0
  468. package/src/qt4-snaps/prod-MapType.snap +8 -0
  469. package/src/qt4-snaps/prod-ModuleImport.snap +224 -0
  470. package/src/qt4-snaps/prod-NameTest.snap +164 -0
  471. package/src/qt4-snaps/prod-NamedFunctionRef.snap +1 -0
  472. package/src/qt4-snaps/prod-NamespaceDecl.snap +80 -0
  473. package/src/qt4-snaps/prod-NodeTest.snap +50 -0
  474. package/src/qt4-snaps/prod-OptionDecl.serialization.snap +14 -0
  475. package/src/qt4-snaps/prod-OptionDecl.snap +20 -0
  476. package/src/qt4-snaps/prod-OrExpr.snap +1 -0
  477. package/src/qt4-snaps/prod-OrderByClause.snap +20 -0
  478. package/src/qt4-snaps/prod-OrderingModeDecl.snap +14 -0
  479. package/src/qt4-snaps/prod-ParenthesizedExpr.snap +1 -0
  480. package/src/qt4-snaps/prod-PathExpr.snap +34 -0
  481. package/src/qt4-snaps/prod-PositionalVar.snap +26 -0
  482. package/src/qt4-snaps/prod-Predicate.snap +14 -0
  483. package/src/qt4-snaps/prod-QuantifiedExpr.snap +164 -0
  484. package/src/qt4-snaps/prod-ReturnClause.snap +8 -0
  485. package/src/qt4-snaps/prod-SequenceType.snap +1 -0
  486. package/src/qt4-snaps/prod-SquareArrayConstructor.snap +1 -0
  487. package/src/qt4-snaps/prod-StepExpr.snap +1 -0
  488. package/src/qt4-snaps/prod-StringConstructor.snap +26 -0
  489. package/src/qt4-snaps/prod-SwitchExpr.snap +1 -0
  490. package/src/qt4-snaps/prod-TreatExpr.snap +14 -0
  491. package/src/qt4-snaps/prod-TryCatchExpr.snap +38 -0
  492. package/src/qt4-snaps/prod-TypeswitchExpr.snap +50 -0
  493. package/src/qt4-snaps/prod-UnaryLookup.snap +1 -0
  494. package/src/qt4-snaps/prod-UnorderedExpr.snap +14 -0
  495. package/src/qt4-snaps/prod-ValueComp.snap +1 -0
  496. package/src/qt4-snaps/prod-VarDecl.external.snap +82 -0
  497. package/src/qt4-snaps/prod-VarDecl.snap +146 -0
  498. package/src/qt4-snaps/prod-VarDefaultValue.snap +8 -0
  499. package/src/qt4-snaps/prod-VersionDecl.snap +68 -0
  500. package/src/qt4-snaps/prod-WhereClause.snap +26 -0
  501. package/src/qt4-snaps/prod-WindowClause.snap +98 -0
  502. package/src/qt4-snaps/ser-method-adaptive.snap +1 -0
  503. package/src/qt4-snaps/ser-method-html.snap +1 -0
  504. package/src/qt4-snaps/ser-method-xml.snap +1 -0
  505. package/src/qt4-snaps/upd-AdditionalTyping.snap +1 -0
  506. package/src/qt4-snaps/upd-AddressBookUpdates.snap +1 -0
  507. package/src/qt4-snaps/upd-AttrDataModelErrs.snap +1 -0
  508. package/src/qt4-snaps/upd-CommaExpression.snap +1 -0
  509. package/src/qt4-snaps/upd-Compatibility.snap +1 -0
  510. package/src/qt4-snaps/upd-ConditionalExpression.snap +1 -0
  511. package/src/qt4-snaps/upd-DeleteExpressions.snap +1 -0
  512. package/src/qt4-snaps/upd-FLWORExpression.snap +1 -0
  513. package/src/qt4-snaps/upd-FullAxis.snap +1 -0
  514. package/src/qt4-snaps/upd-FunctionCall.snap +1 -0
  515. package/src/qt4-snaps/upd-FunctionDeclaration.snap +114 -0
  516. package/src/qt4-snaps/upd-InsertExpressions.snap +1 -0
  517. package/src/qt4-snaps/upd-MinOther.snap +1 -0
  518. package/src/qt4-snaps/upd-NSBindingConflictErrs.snap +1 -0
  519. package/src/qt4-snaps/upd-NamespacesUpdates.snap +1 -0
  520. package/src/qt4-snaps/upd-NilUpdates.snap +10 -0
  521. package/src/qt4-snaps/upd-OtherExpressions.snap +1 -0
  522. package/src/qt4-snaps/upd-ParenthesizedExpressions.snap +1 -0
  523. package/src/qt4-snaps/upd-PartsUpdates.snap +1 -0
  524. package/src/qt4-snaps/upd-RelationalDataUpdates.snap +1 -0
  525. package/src/qt4-snaps/upd-RenameExpressions.snap +1 -0
  526. package/src/qt4-snaps/upd-ReplaceNode.snap +1 -0
  527. package/src/qt4-snaps/upd-ReplaceValue.snap +1 -0
  528. package/src/qt4-snaps/upd-RevalidationDeclarationLax.snap +1 -0
  529. package/src/qt4-snaps/upd-RevalidationDeclarationLaxUnsupported.snap +1 -0
  530. package/src/qt4-snaps/upd-RevalidationDeclarationSkip.snap +10 -0
  531. package/src/qt4-snaps/upd-RevalidationDeclarationSkipUnsupported.snap +1 -0
  532. package/src/qt4-snaps/upd-RevalidationDeclarationStrict.snap +1 -0
  533. package/src/qt4-snaps/upd-RevalidationDeclarationStrictUnsupported.snap +1 -0
  534. package/src/qt4-snaps/upd-RevalidationDeclarationStrictandSkip.snap +1 -0
  535. package/src/qt4-snaps/upd-SoapUpdates.snap +1 -0
  536. package/src/qt4-snaps/upd-TransformExpressions.snap +1 -0
  537. package/src/qt4-snaps/upd-TypeswitchExpression.snap +1 -0
  538. package/src/qt4-snaps/upd-VariableDeclaration.snap +1 -0
  539. package/src/qt4-snaps/upd-applyUpdates.snap +1 -0
  540. package/src/qt4-snaps/upd-fnput-document.snap +1 -0
  541. package/src/qt4-snaps/upd-mergeUpdates.snap +1 -0
  542. package/src/qt4-snaps/upd-propagateNamespace.snap +1 -0
  543. package/src/qt4-snaps/upd-setToUntyped.snap +1 -0
  544. package/src/qt4-snaps/xs-anyAtomicType.snap +1 -0
  545. package/src/qt4-snaps/xs-anySimpleType.snap +8 -0
  546. package/src/qt4-snaps/xs-anyURI.snap +34 -0
  547. package/src/qt4-snaps/xs-base64Binary.snap +1 -0
  548. package/src/qt4-snaps/xs-dateTimeStamp.snap +1 -0
  549. package/src/qt4-snaps/xs-double.snap +1 -0
  550. package/src/qt4-snaps/xs-error.snap +10 -0
  551. package/src/qt4-snaps/xs-float.snap +1 -0
  552. package/src/qt4-snaps/xs-hexBinary.snap +1 -0
  553. package/src/qt4-snaps/xs-normalizedString.snap +1 -0
  554. package/src/qt4-snaps/xs-notation.snap +1 -0
  555. package/src/qt4-snaps/xs-numeric.snap +1 -0
  556. package/src/qt4-snaps/xs-token.snap +1 -0
  557. package/src/qt4-worker.ts +63 -0
  558. package/src/runtimes/existdb/cache.xq +83 -0
  559. package/src/runtimes/existdb/compression.xq +198 -0
  560. package/src/runtimes/existdb/console.xq +24 -0
  561. package/src/runtimes/existdb/contentextraction.xq +31 -0
  562. package/src/runtimes/existdb/counter.xq +30 -0
  563. package/src/runtimes/existdb/crypto.xq +97 -0
  564. package/src/runtimes/existdb/datetime.xq +91 -0
  565. package/src/runtimes/existdb/file.xq +129 -0
  566. package/src/runtimes/existdb/ft.xq +325 -0
  567. package/src/runtimes/existdb/httpclient.xq +118 -0
  568. package/src/runtimes/existdb/image.xq +65 -0
  569. package/src/runtimes/existdb/inspect.xq +49 -0
  570. package/src/runtimes/existdb/kwic.xq +24 -0
  571. package/src/runtimes/existdb/mail.xq +124 -0
  572. package/src/runtimes/existdb/ngram.xq +57 -0
  573. package/src/runtimes/existdb/process.xq +8 -0
  574. package/src/runtimes/existdb/range.xq +171 -0
  575. package/src/runtimes/existdb/repo.xq +125 -0
  576. package/src/runtimes/existdb/request.xq +242 -0
  577. package/src/runtimes/existdb/response.xq +50 -0
  578. package/src/runtimes/existdb/scheduler.xq +35 -0
  579. package/src/runtimes/existdb/session.xq +111 -0
  580. package/src/runtimes/existdb/sm.xq +497 -0
  581. package/src/runtimes/existdb/sort.xq +59 -0
  582. package/src/runtimes/existdb/system.xq +267 -0
  583. package/src/runtimes/existdb/transform.xq +88 -0
  584. package/src/runtimes/existdb/util.xq +860 -0
  585. package/src/runtimes/existdb/validation.xq +83 -0
  586. package/src/runtimes/existdb/xmldb.xq +482 -0
  587. package/src/runtimes/existdb/xmldiff.xq +22 -0
  588. package/src/runtimes/fonto/fonto.xq +164 -0
  589. package/src/runtimes.test.ts +152 -0
  590. package/src/runtimes.ts +70 -0
  591. package/src/server.ts +352 -122
  592. package/src/test-utils.ts +17 -0
  593. package/src/typechecker.test.ts +548 -0
  594. package/src/typechecker.ts +416 -0
  595. package/src/types.ts +41 -7
  596. package/src/unused-diagnostics.test.ts +174 -0
  597. package/src/unused-diagnostics.ts +232 -0
  598. package/tsconfig.json +3 -3
@@ -0,0 +1,325 @@
1
+ module namespace ft = "http://exist-db.org/xquery/lucene";
2
+
3
+ (:~
4
+ : Returns the value of a binary field attached to a particular node obtained
5
+ : via a full text search. Accepts an additional parameter to name the target
6
+ : type into which the field value should be cast. This is mainly relevant for
7
+ : fields having a different type than xs:string. As lucene does not record
8
+ : type information, numbers or dates would be returned as strings by default.
9
+ : @param $node the context node to check for attached fields
10
+ : @param $field name of the field
11
+ : @param $type intended target type to cast the field value to. Empty sequence returns raw (untyped) values as the 2-arg form. Casting may fail with a dynamic error.
12
+ : @return Sequence corresponding to the values of the field attached, cast to the desired target type
13
+ :)
14
+ declare function ft:binary-field($node as node(), $field as xs:string, $type as xs:string?) as item()* external;
15
+
16
+ (:~
17
+ : Close the current Lucene document and flush it to disk. Subsequent calls to
18
+ : ft:index will write to a new Lucene document.
19
+ :)
20
+ declare function ft:close() as empty-sequence() external;
21
+
22
+ (:~
23
+ : Return a map of facet labels and counts for the result of a Lucene query.
24
+ : @param $nodes A sequence of nodes for which facet counts should be returned. If the nodes in the sequence resulted from different Lucene queries, their facet counts will be merged. If no node in the the sequence has facets attached or the sequence is empty, an empty map is returned.
25
+ : @param $dimension The facet dimension. This should correspond to a dimension defined in the index configuration
26
+ : @return A map having the facet label as key and the facet count as value
27
+ :)
28
+ declare function ft:facets($nodes as node()*, $dimension as xs:string) as map(*) external;
29
+
30
+ (:~
31
+ : Return a map of facet labels and counts for the result of a Lucene query.
32
+ : @param $nodes A sequence of nodes for which facet counts should be returned. If the nodes in the sequence resulted from different Lucene queries, their facet counts will be merged. If no node in the the sequence has facets attached or the sequence is empty, an empty map is returned.
33
+ : @param $dimension The facet dimension. This should correspond to a dimension defined in the index configuration
34
+ : @param $count The number of facet labels to be returned. Facets with more occurrences in the result will be returned first.
35
+ : @return A map having the facet label as key and the facet count as value
36
+ :)
37
+ declare function ft:facets($nodes as node()*, $dimension as xs:string, $count as xs:integer?) as map(*) external;
38
+
39
+ (:~
40
+ : Return a map of facet labels and counts for the result of a Lucene query.
41
+ : @param $nodes A sequence of nodes for which facet counts should be returned. If the nodes in the sequence resulted from different Lucene queries, their facet counts will be merged. If no node in the the sequence has facets attached or the sequence is empty, an empty map is returned.
42
+ : @param $dimension The facet dimension. This should correspond to a dimension defined in the index configuration
43
+ : @param $count The number of facet labels to be returned. Facets with more occurrences in the result will be returned first.
44
+ : @param $paths For hierarchical facets, specify a sequence of paths leading to the position in the hierarchy you would like to get facet counts for.
45
+ : @return A map having the facet label as key and the facet count as value
46
+ :)
47
+ declare function ft:facets(
48
+ $nodes as node()*,
49
+ $dimension as xs:string,
50
+ $count as xs:integer?,
51
+ $paths as xs:string+
52
+ ) as map(*) external;
53
+
54
+ (:~
55
+ : Returns the value of a field attached to a particular node obtained via a
56
+ : full text search. The $type parameter allows you to name the target type
57
+ : into which the field value should be cast. This is mainly relevant for
58
+ : fields having a different type than xs:string. As lucene does not record
59
+ : type information, numbers or dates would be returned as strings by default.
60
+ : @param $node the context node to check for attached fields
61
+ : @param $field name of the field
62
+ : @return Sequence corresponding to the values of the field attached, cast to the desired target type
63
+ :)
64
+ declare function ft:field($node as node(), $field as xs:string) as item()* external;
65
+
66
+ (:~
67
+ : Returns the value of a field attached to a particular node obtained via a
68
+ : full text search. The $type parameter allows you to name the target type
69
+ : into which the field value should be cast. This is mainly relevant for
70
+ : fields having a different type than xs:string. As lucene does not record
71
+ : type information, numbers or dates would be returned as strings by default.
72
+ : @param $node the context node to check for attached fields
73
+ : @param $field name of the field
74
+ : @param $type intended target type to cast the field value to. Empty sequence returns raw (untyped) values as the 2-arg form. Casting may fail with a dynamic error.
75
+ : @return Sequence corresponding to the values of the field attached, cast to the desired target type
76
+ :)
77
+ declare function ft:field($node as node(), $field as xs:string, $type as xs:string?) as item()* external;
78
+
79
+ (:~
80
+ : Retrieve the stored content of a field.
81
+ : @deprecated Use an index definition with nested fields and ft:field instead
82
+ : @param $path URI paths of documents or collections in database. Collection URIs should end on a '/'.
83
+ : @param $field query string
84
+ : @return All documents that are match by the query
85
+ :)
86
+ declare function ft:get-field($path as xs:string*, $field as xs:string) as xs:string* external;
87
+
88
+ (:~
89
+ : Check if the given document has a lucene index defined on it. This method
90
+ : will return true for both, indexes created via collection.xconf or manual
91
+ : index fields added to the document with ft:index.
92
+ : @param $path Full path to the resource to check
93
+ :)
94
+ declare function ft:has-index($path as xs:string) as xs:boolean* external;
95
+
96
+ (:~
97
+ : Highlights matches for the last executed lucene query within the value of a
98
+ : field attached to a particular node obtained via a full text search. Only
99
+ : fields listed in the 'fields' option of ft:query will be available to
100
+ : highlighting. Accepts zero or more nodes; empty input returns empty.
101
+ : @param $nodes zero or more context nodes (empty returns empty)
102
+ : @param $field name of the field
103
+ : @return exist:field elements with matches enclosed in exist:match
104
+ :)
105
+ declare function ft:highlight-field-matches($nodes as node()*, $field as xs:string) as element()* external;
106
+
107
+ (:~
108
+ : Index an arbitrary chunk of (non-XML) data with Lucene. Syntax is inspired
109
+ : by Solr.
110
+ : @param $documentPath URI path of document in database.
111
+ : @param $solrExression XML syntax expected by Solr's add expression. Element should be called 'doc', e.g. <doc> <field name="field1">data1</field> <field name="field2" boost="value">data2</field> </doc>
112
+ :)
113
+ declare function ft:index($documentPath as xs:string, $solrExression as node()) as empty-sequence() external;
114
+
115
+ (:~
116
+ : Index an arbitrary chunk of (non-XML) data with Lucene. Syntax is inspired
117
+ : by Solr.
118
+ : @param $documentPath URI path of document in database.
119
+ : @param $solrExression XML syntax expected by Solr's add expression. Element should be called 'doc', e.g. <doc> <field name="field1">data1</field> <field name="field2" boost="value">data2</field> </doc>
120
+ : @param $close If true, close the Lucene document. Subsequent calls to ft:index will thus add to a new Lucene document. If false, the document remains open and is not flushed to disk. Call the ft:close function to explicitely close and flush the current document.
121
+ :)
122
+ declare function ft:index(
123
+ $documentPath as xs:string,
124
+ $solrExression as node(),
125
+ $close as xs:boolean
126
+ ) as empty-sequence() external;
127
+
128
+ (:~
129
+ : Similar to the util:index-keys functions, but returns index entries for a
130
+ : field associated with a lucene index.
131
+ : @param $field The name of the field
132
+ : @param $start-value Only keys starting with the given prefix are reported.
133
+ : @param $function-reference A function reference. It can be an arbitrary user-defined function, but it should take exactly 2 arguments:
134
+ : @param $max-number-returned The maximum number of keys to return
135
+ : @return the results of the eval of the $function-reference
136
+ :)
137
+ declare function ft:index-keys-for-field(
138
+ $field as xs:string,
139
+ $start-value as xs:string?,
140
+ $function-reference as function(*),
141
+ $max-number-returned as xs:integer?
142
+ ) as item()* external;
143
+
144
+ (:~
145
+ : Calls Lucene's optimize method to merge all index segments into a single
146
+ : one. This is a costly operation and should not be used except for data sets
147
+ : which can be expected to remain unchanged for a while. The optimize will
148
+ : block the index for other write operations and may take some time. You need
149
+ : to be a user in group dba to call this function.
150
+ :)
151
+ declare function ft:optimize() as empty-sequence() external;
152
+
153
+ (:~
154
+ : Queries a node set using a Lucene full text index; a lucene index must
155
+ : already be defined on the nodes, because if no index is available on a node,
156
+ : nothing will be found. Indexes on descendant nodes are not used. The context
157
+ : of the Lucene query is determined by the given input node set. The query is
158
+ : specified either as a query string based on Lucene's default query syntax or
159
+ : as an XML fragment. See https://exist-db.org/exist/apps/doc/lucene.xml#query
160
+ : for complete documentation.
161
+ : @param $nodes The node set to search using a Lucene full text index which is defined on those nodes
162
+ : @param $query The query to search for, provided either as a string or text in Lucene's default query syntax or as an XML fragment to bypass Lucene's default query parser
163
+ : @return all nodes from the input node set matching the query. match highlighting information will be available for all returned nodes. Lucene's match score can be retrieved via the ft:score function.
164
+ :)
165
+ declare function ft:query($nodes as node()*, $query as item()?) as node()* external;
166
+
167
+ (:~
168
+ : Queries a node set using a Lucene full text index; a lucene index must
169
+ : already be defined on the nodes, because if no index is available on a node,
170
+ : nothing will be found. Indexes on descendant nodes are not used. The context
171
+ : of the Lucene query is determined by the given input node set. The query is
172
+ : specified either as a query string based on Lucene's default query syntax or
173
+ : as an XML fragment. See https://exist-db.org/exist/apps/doc/lucene.xml#query
174
+ : for complete documentation.
175
+ : @param $nodes The node set to search using a Lucene full text index which is defined on those nodes
176
+ : @param $query The query to search for, provided either as a string or text in Lucene's default query syntax or as an XML fragment to bypass Lucene's default query parser
177
+ : @param $options An XML fragment or XDM Map containing options to be passed to Lucene's query parser. The following options are supported (a description can be found in the docs): <options> <default-operator>and|or</default-operator> <phrase-slop>number</phrase-slop> <leading-wildcard>yes|no</leading-wildcard> <filter-rewrite>yes|no</filter-rewrite> <lowercase-expanded-terms>yes|no</lowercase-expanded-terms> </options>
178
+ : @return all nodes from the input node set matching the query. match highlighting information will be available for all returned nodes. Lucene's match score can be retrieved via the ft:score function.
179
+ :)
180
+ declare function ft:query($nodes as node()*, $query as item()?, $options as item()?) as node()* external;
181
+
182
+ (:~
183
+ : Queries a Lucene field, which has to be explicitely created in the index
184
+ : configuration.
185
+ : @param $field The lucene field name.
186
+ : @param $query The query to search for, provided either as a string or text in Lucene's default query syntax or as an XML fragment to bypass Lucene's default query parser
187
+ : @return all nodes from the input node set matching the query. match highlighting information will be available for all returned nodes. Lucene's match score can be retrieved via the ft:score function.
188
+ :)
189
+ declare function ft:query-field($field as xs:string*, $query as item()) as node()* external;
190
+
191
+ (:~
192
+ : Queries a Lucene field, which has to be explicitely created in the index
193
+ : configuration.
194
+ : @param $field The lucene field name.
195
+ : @param $query The query to search for, provided either as a string or text in Lucene's default query syntax or as an XML fragment to bypass Lucene's default query parser
196
+ : @param $options An XML fragment or XDM Map containing options to be passed to Lucene's query parser. The following options are supported (a description can be found in the docs): <options> <default-operator>and|or</default-operator> <phrase-slop>number</phrase-slop> <leading-wildcard>yes|no</leading-wildcard> <filter-rewrite>yes|no</filter-rewrite> </options>
197
+ : @return all nodes from the input node set matching the query. match highlighting information will be available for all returned nodes. Lucene's match score can be retrieved via the ft:score function.
198
+ :)
199
+ declare function ft:query-field($field as xs:string*, $query as item(), $options as item()?) as node()* external;
200
+
201
+ (:~
202
+ : KNN vector search by field name. Uses context document set.
203
+ : @param $field The vector field name (from vector-field config).
204
+ : @param $vector Query vector as XQuery array of numbers.
205
+ : @return Nodes matching the vector query.
206
+ :)
207
+ declare function ft:query-field-vector($field as xs:string, $vector as array(*)) as node()* external;
208
+
209
+ (:~
210
+ : KNN vector search by field with explicit k.
211
+ : @param $field The vector field name (from vector-field config).
212
+ : @param $vector Query vector as XQuery array of numbers.
213
+ : @param $k Number of nearest neighbours (default 10).
214
+ : @return Nodes matching the vector query.
215
+ :)
216
+ declare function ft:query-field-vector($field as xs:string, $vector as array(*), $k as xs:integer?) as node()* external;
217
+
218
+ (:~
219
+ : KNN vector search by field with k and options.
220
+ : @param $field The vector field name (from vector-field config).
221
+ : @param $vector Query vector as XQuery array of numbers.
222
+ : @param $k Number of nearest neighbours (default 10).
223
+ : @param $options Optional map with filter-query, filter, facets.
224
+ : @return Nodes matching the vector query.
225
+ :)
226
+ declare function ft:query-field-vector(
227
+ $field as xs:string,
228
+ $vector as array(*),
229
+ $k as xs:integer?,
230
+ $options as item()?
231
+ ) as node()* external;
232
+
233
+ (:~
234
+ : KNN vector search. Returns k nearest nodes. Vector field is resolved from
235
+ : index config.
236
+ : @param $nodes The node set to search (e.g. collection(...)//article). Document set and qnames are derived from this.
237
+ : @param $vector Query vector as XQuery array of numbers, e.g. [1.0, 0.0, 0.0, 0.0].
238
+ : @return Nodes matching the vector query, ordered by similarity.
239
+ :)
240
+ declare function ft:query-vector($nodes as node()*, $vector as array(*)) as node()* external;
241
+
242
+ (:~
243
+ : KNN vector search with explicit k.
244
+ : @param $nodes The node set to search (e.g. collection(...)//article). Document set and qnames are derived from this.
245
+ : @param $vector Query vector as XQuery array of numbers, e.g. [1.0, 0.0, 0.0, 0.0].
246
+ : @param $k Number of nearest neighbours to return (default 10).
247
+ : @return Nodes matching the vector query, ordered by similarity.
248
+ :)
249
+ declare function ft:query-vector($nodes as node()*, $vector as array(*), $k as xs:integer?) as node()* external;
250
+
251
+ (:~
252
+ : KNN vector search with k and options (filter-query, filter, facets).
253
+ : @param $nodes The node set to search (e.g. collection(...)//article). Document set and qnames are derived from this.
254
+ : @param $vector Query vector as XQuery array of numbers, e.g. [1.0, 0.0, 0.0, 0.0].
255
+ : @param $k Number of nearest neighbours to return (default 10).
256
+ : @param $options Optional map with filter-query, filter, facets.
257
+ : @return Nodes matching the vector query, ordered by similarity.
258
+ :)
259
+ declare function ft:query-vector(
260
+ $nodes as node()*,
261
+ $vector as array(*),
262
+ $k as xs:integer?,
263
+ $options as item()?
264
+ ) as node()* external;
265
+
266
+ (:~
267
+ : Remove any (non-XML) Lucene index associated with the document identified by
268
+ : the path parameter. This function will only remove indexes which were
269
+ : manually created by the user via the ft:index function. Indexes defined in
270
+ : collection.xconf will NOT be removed. They are maintained automatically by
271
+ : the database. Please note that non-XML indexes will also be removed
272
+ : automatically if the associated document is deleted.
273
+ : @param $documentPath URI path of document in database.
274
+ :)
275
+ declare function ft:remove-index($documentPath as xs:string) as empty-sequence() external;
276
+
277
+ (:~
278
+ : Returns a computed relevance score for the given node. The score is the sum
279
+ : of all relevance scores provided by Lucene for the node and its descendants.
280
+ : In general, the score will be a number between 0.0 and 1.0 if the query had
281
+ : $node as context. If the query targeted multiple descendants of $node (e.g.
282
+ : 'title' and 'author' within a 'book'), the score will be the sum of all
283
+ : sub-scores and may thus be greater than 1.
284
+ : @param $node the context node
285
+ : @return sum of all relevance scores provided by Lucene for all matches below the given context node
286
+ :)
287
+ declare function ft:score($node as node()) as xs:float* external;
288
+
289
+ (:~
290
+ : Search for (non-XML) data with lucene
291
+ : @param $query query string
292
+ : @return All documents that are match by the query
293
+ :)
294
+ declare function ft:search($query as xs:string) as node() external;
295
+
296
+ (:~
297
+ : Search for (non-XML) data with lucene
298
+ : @param $path URI paths of documents or collections in database. Collection URIs should end on a '/'.
299
+ : @param $query query string
300
+ : @return All documents that are match by the query
301
+ :)
302
+ declare function ft:search($path as xs:string*, $query as xs:string) as node() external;
303
+
304
+ (:~
305
+ : Search for (non-XML) data with lucene
306
+ : @param $path URI paths of documents or collections in database. Collection URIs should end on a '/'.
307
+ : @param $query query string
308
+ : @param $fields Fields to return in search results
309
+ : @return All documents that are match by the query
310
+ :)
311
+ declare function ft:search($path as xs:string*, $query as xs:string, $fields as xs:string*) as node() external;
312
+
313
+ (:~
314
+ : Search for (non-XML) data with lucene
315
+ : @param $path URI paths of documents or collections in database. Collection URIs should end on a '/'.
316
+ : @param $query query string
317
+ : @param $fields Fields to return in search results
318
+ : @return All documents that are match by the query
319
+ :)
320
+ declare function ft:search(
321
+ $path as xs:string*,
322
+ $query as xs:string,
323
+ $fields as xs:string*,
324
+ $options as node()?
325
+ ) as node() external;
@@ -0,0 +1,118 @@
1
+ module namespace httpclient = "http://exist-db.org/xquery/httpclient";
2
+
3
+ (:~
4
+ : Sends an HTTP GET request to the given URI and returns the response.
5
+ : @param $uri The URI to request
6
+ : @param $persist If true, keep the HTTP connection alive for subsequent requests
7
+ : @param $request-headers A sequence of header elements, or the empty sequence
8
+ :)
9
+ declare function httpclient:get(
10
+ $uri as xs:anyURI,
11
+ $persist as xs:boolean,
12
+ $request-headers as element()?
13
+ ) as element() external;
14
+
15
+ (:~
16
+ : Sends an HTTP HEAD request to the given URI.
17
+ : @param $uri The URI to request
18
+ : @param $persist If true, keep the HTTP connection alive
19
+ : @param $request-headers A sequence of header elements, or the empty sequence
20
+ :)
21
+ declare function httpclient:head(
22
+ $uri as xs:anyURI,
23
+ $persist as xs:boolean,
24
+ $request-headers as element()?
25
+ ) as element() external;
26
+
27
+ (:~
28
+ : Sends an HTTP POST request to the given URI with the given body.
29
+ : @param $uri The URI to request
30
+ : @param $content The request body (node or xs:string)
31
+ : @param $persist If true, keep the HTTP connection alive
32
+ : @param $request-headers A sequence of header elements, or the empty sequence
33
+ :)
34
+ declare function httpclient:post(
35
+ $uri as xs:anyURI,
36
+ $content as item(),
37
+ $persist as xs:boolean,
38
+ $request-headers as element()?
39
+ ) as element() external;
40
+
41
+ (:~
42
+ : Sends an HTTP POST request with a named content type.
43
+ : @param $uri The URI to request
44
+ : @param $content The request body
45
+ : @param $persist If true, keep the HTTP connection alive
46
+ : @param $request-headers Request headers element
47
+ : @param $content-type The Content-Type header value
48
+ :)
49
+ declare function httpclient:post(
50
+ $uri as xs:anyURI,
51
+ $content as item(),
52
+ $persist as xs:boolean,
53
+ $request-headers as element()?,
54
+ $content-type as xs:string
55
+ ) as element() external;
56
+
57
+ (:~
58
+ : Sends an HTTP PUT request to the given URI.
59
+ : @param $uri The URI to request
60
+ : @param $content The request body
61
+ : @param $persist If true, keep the HTTP connection alive
62
+ : @param $request-headers Request headers element
63
+ :)
64
+ declare function httpclient:put(
65
+ $uri as xs:anyURI,
66
+ $content as item(),
67
+ $persist as xs:boolean,
68
+ $request-headers as element()?
69
+ ) as element() external;
70
+
71
+ (:~
72
+ : Sends an HTTP DELETE request to the given URI.
73
+ : @param $uri The URI to request
74
+ : @param $persist If true, keep the HTTP connection alive
75
+ : @param $request-headers Request headers element
76
+ :)
77
+ declare function httpclient:delete(
78
+ $uri as xs:anyURI,
79
+ $persist as xs:boolean,
80
+ $request-headers as element()?
81
+ ) as element() external;
82
+
83
+ (:~
84
+ : Sends an HTTP OPTIONS request to the given URI.
85
+ : @param $uri The URI to request
86
+ : @param $persist If true, keep the HTTP connection alive
87
+ : @param $request-headers Request headers element
88
+ :)
89
+ declare function httpclient:options(
90
+ $uri as xs:anyURI,
91
+ $persist as xs:boolean,
92
+ $request-headers as element()?
93
+ ) as element() external;
94
+
95
+ (:~
96
+ : Sends an HTTP PATCH request to the given URI.
97
+ : @param $uri The URI to request
98
+ : @param $content The request body
99
+ : @param $persist If true, keep the HTTP connection alive
100
+ : @param $request-headers Request headers element
101
+ :)
102
+ declare function httpclient:patch(
103
+ $uri as xs:anyURI,
104
+ $content as item(),
105
+ $persist as xs:boolean,
106
+ $request-headers as element()?
107
+ ) as element() external;
108
+
109
+ (:~
110
+ : Clears all persistent HTTP connections maintained by the client.
111
+ :)
112
+ declare function httpclient:clear-response-cache() as empty-sequence() external;
113
+
114
+ (:~
115
+ : Encodes a string for use in a URL (percent-encoding).
116
+ : @param $string The string to encode
117
+ :)
118
+ declare function httpclient:encode-url($string as xs:string) as xs:string external;
@@ -0,0 +1,65 @@
1
+ module namespace image = "http://exist-db.org/xquery/image";
2
+
3
+ (:~
4
+ : Crop the image $image to a specified dimension. If no dimensions are
5
+ : specified, then the default values are 'y1 = 0', 'x1 = 0', 'x2 = 100' and
6
+ : 'y2 = 100'.
7
+ : @param $image The image data
8
+ : @param $mimeType The mime-type of the image
9
+ : @return the cropd image or an empty sequence if $image is invalid
10
+ :)
11
+ declare function image:crop(
12
+ $image as xs:base64Binary,
13
+ $dimension as xs:integer*,
14
+ $mimeType as xs:string
15
+ ) as xs:base64Binary? external;
16
+
17
+ (:~
18
+ : Gets the Height of the image passed in, returning an integer of the images
19
+ : Height in pixels or an empty sequence if the image is invalid.
20
+ : @param $image The image data
21
+ : @return the height in pixels
22
+ :)
23
+ declare function image:get-height($image as xs:base64Binary) as xs:integer? external;
24
+
25
+ (:~
26
+ : Gets the width of the image passed in, returning an integer of the images
27
+ : width in pixels or an empty sequence if the image is invalid.
28
+ : @param $image The image data
29
+ : @return the width in pixels
30
+ :)
31
+ declare function image:get-width($image as xs:base64Binary) as xs:integer? external;
32
+
33
+ (:~
34
+ : @param $image The image data
35
+ : @param $options A map of options for transforming the image. The map should be formatted like: map { 'source': map { 'media-type': xs:string }, 'destination': map { 'max-height': xs:integer?, 'max-width': xs:integer?, 'rendering-hints': map { $image:alpha-interpolation: ($image:alpha-interpolation_default|$image:alpha-interpolation_speed|$image:alpha-interpolation_default)?, $image:antialiasing: ($image:antialiasing_default|$image:antialiasing_on|$image:antialiasing_off)?, $image:color-rendering: ($image:color-rendering_default|$image:color-rendering_speed|$image:color-rendering_quality)?, $image:dithering: ($image:dithering_default|$image:dithering_enable|$image:dithering_disable)?, $image:fractional-metrics: ($image:fractional-metrics_default|$image:fractional-metrics_on|$image:fractional-metrics_off)?, $image:interpolation: ($image:interpolation_nearest_neighbor|$image:interpolation_bilinear|$image:interpolation_bicubic)?, $image:rendering: ($image:rendering_default|$image:rendering_speed|$image:rendering_quality)?, $image:resolution-variant: ($image:resolution-variant_default|$image:resolution-variant_base|$image:resolution-variant_size_fit|$image:resolution-variant_dpi_fit)?, $image:stroke-control: ($image:stroke-control_default|$image:stroke-control_normalize|$image:stroke-control_pure)?, $image:text-antialiasing: ($image:text-antialiasing_default|$image:text-antialiasing_on|$image:text-antialiasing_off|$image:text-antialiasing_gasp|$image:text-antialiasing_lcd_hrgb|$image:text-antialiasing_lcd_hbgr|$image:text-antialiasing_lcd_vrgb|$image:text-antialiasing_lcd_vbgr)? }?}
36
+ : @return the scaled image or an empty sequence if $image is invalid
37
+ :)
38
+ declare function image:scale($image as xs:base64Binary, $options as map(*)) as xs:base64Binary? external;
39
+
40
+ (:~
41
+ : @param $image The image data
42
+ : @param $dimension The maximum dimension of the scaled image. expressed in pixels (maxheight, maxwidth). If empty, then the default values are 'maxheight = 100' and 'maxwidth = 100'.
43
+ : @param $media-type The mime-type of the image
44
+ : @return the scaled image or an empty sequence if $image is invalid
45
+ :)
46
+ declare function image:scale(
47
+ $image as xs:base64Binary,
48
+ $dimension as xs:integer*,
49
+ $media-type as xs:string
50
+ ) as xs:base64Binary? external;
51
+
52
+ (:~
53
+ : Generate thumbnails from the given database collection
54
+ : @param $collection The URI to the collection
55
+ : @param $thumbnail-location The location in the database where the thumbnails should be created, this can be a local path, with the prefix 'xmldb:' a absolute path within the database or with 'rel:' path relative to the given $collection. You can leave this empty then the default is 'rel:/thumbs'.
56
+ : @param $dimension The dimension of the thumbnails, if empty then the default values are 'maxheight = 100' and 'maxwidth = 100', the first value is 'maxheight' and the second 'maxwidth'.
57
+ : @param $prefix The prefix to append to the thumbnail filenames
58
+ : @return the result
59
+ :)
60
+ declare function image:thumbnail(
61
+ $collection as xs:anyURI,
62
+ $thumbnail-location as xs:anyURI?,
63
+ $dimension as xs:integer*,
64
+ $prefix as xs:string?
65
+ ) as xs:string* external;
@@ -0,0 +1,49 @@
1
+ module namespace inspect = "http://exist-db.org/xquery/inspection";
2
+
3
+ (:~
4
+ : Returns an XML fragment describing the function referenced by the passed
5
+ : function item.
6
+ : @param $function The function item to inspect
7
+ : @return the signature of the function
8
+ :)
9
+ declare function inspect:inspect-function($function as function(*)) as node() external;
10
+
11
+ (:~
12
+ : Compiles a library module from source (without importing it) and returns an
13
+ : XML fragment describing the module and the functions/variables contained in
14
+ : it.
15
+ : @param $location The location URI of the module to inspect
16
+ :)
17
+ declare function inspect:inspect-module($location as xs:anyURI) as item()* external;
18
+
19
+ (:~
20
+ : Returns an XML fragment describing the library module identified by the
21
+ : given namespace URI and the functions/variables contained in it.
22
+ : @param $uri The namespace URI of the module to inspect
23
+ :)
24
+ declare function inspect:inspect-module-uri($uri as xs:anyURI) as item()* external;
25
+
26
+ (:~
27
+ : Returns a sequence of function items pointing to each public function in the
28
+ : module. If no $location is provided, then the current (calling) module is
29
+ : inspected.
30
+ : @return Sequence of function items containing all public functions in the module, or the empty sequence if the module is not known in the current context.
31
+ :)
32
+ declare function inspect:module-functions() as function(*)* external;
33
+
34
+ (:~
35
+ : Returns a sequence of function items pointing to each public function in the
36
+ : module. If no $location is provided, then the current (calling) module is
37
+ : inspected.
38
+ : @param $location The location URI of the module to be inspected.
39
+ : @return Sequence of function items containing all public functions in the module, or the empty sequence if the module is not known in the current context.
40
+ :)
41
+ declare function inspect:module-functions($location as xs:anyURI) as function(*)* external;
42
+
43
+ (:~
44
+ : Returns a sequence of function items pointing to each public function in the
45
+ : specified module.
46
+ : @param $uri The URI of the module to be loaded.
47
+ : @return Sequence of function items containing all public functions in the module, or the empty sequence if the module is not known in the current context.
48
+ :)
49
+ declare function inspect:module-functions-by-uri($uri as xs:anyURI) as function(*)* external;
@@ -0,0 +1,24 @@
1
+ module namespace kwic = "http://exist-db.org/xquery/kwic";
2
+
3
+ (:~
4
+ : Returns a KWIC (Key Word In Context) summary for the given match node.
5
+ : The result is an element with &lt;exist:match&gt; children wrapping the match terms.
6
+ : @param $node The node containing a Lucene full-text match
7
+ : @param $config A &lt;kwic:config&gt; element controlling width and truncation
8
+ :)
9
+ declare function kwic:summarize($node as node(), $config as element()) as element()? external;
10
+
11
+ (:~
12
+ : Returns a KWIC summary calling a callback function for each match.
13
+ : @param $node The node containing a Lucene full-text match
14
+ : @param $config A &lt;kwic:config&gt; element
15
+ : @param $callback A function called for each match with (match, mode) arguments
16
+ :)
17
+ declare function kwic:summarize($node as node(), $config as element(), $callback as function(*)) as element()? external;
18
+
19
+ (:~
20
+ : Gets the text before a Lucene match term.
21
+ : @param $node The match node
22
+ : @param $chars Maximum number of characters of context before the match
23
+ :)
24
+ declare function kwic:get-text($node as node(), $chars as xs:integer) as xs:string? external;