Search code examples
xqueryexist-db

Migrating from Exist DB 2.1 to 5.x - Missing modules/functions


I'm in the process of migrating an Exist DB app based on 2.1 to 5.x and am having trouble finding replacements for a couple of apparently deprecated / moved functions. They are:

  • context:get-attribute
  • context:set-attribute
  • text:groups-regex

Any guidance on replacements or alternative approaches would be greatly appreciated.

Thanks.


Solution

  • The Context Module was removed in eXist-db 5.0.0 as its only purpose was to allow mutable variable storage within a single running XQuery. This is really just bad-practice, instead your XQuery should be refactored to pass variables around.

    Instead of text:groups-regex, you probably want fn:analyze-string.