diff --git a/data/doc/documentation.xml b/data/doc/documentation.xml index ed0804c8..b615eabd 100644 --- a/data/doc/documentation.xml +++ b/data/doc/documentation.xml @@ -2879,6 +2879,24 @@ declare function pmf:code($config as map(*), $node as element(), $class as xs:st +
+ Accessing Global Configuration Variables/Functions + Sometimes you may want to access global configuration parameters, e.g. to determine + the data root collection of the current application. tei-publisher-lib + 4.0.0 imported the entire modules/config.xqm into the + XQuery code generated from the ODD, and exposed it in the global + namespace. This way one could access the data root as + $global:data-root inside a predicate or parameter expression in + the ODD. However, the complexity of config.xqm caused unnecessary overhead and failures on Windows. + Version 4.0.1 instead allows you to explicitely import one or more modules in the ODD + processing configuration file (odd/configuration.xml or + resources/odd/configuration.xml). + + + + ... +]]> +
@@ -4506,13 +4524,18 @@ declare function config:collection-config($collection as xs:string?, $docUri as when compiling an ODD. The underlying reason is that config.xqm itself imports a large number of other modules, leading to recursive imports, which eXist-db is currently unable to resolve properly on Windows. In general, importing all of config.xqm into the ODD generated code - is usually unnecessary as most of the settings are not needed. This creates an overhead. - Version 4.0.1 of tei-publisher-lib therefore no longer imports + is usually unnecessary as most of the settings are not needed. Version 4.0.1 of + tei-publisher-lib therefore no longer imports config.xqm by default. Instead, you can configure the modules to be made available via odd/configuration.xml (or resources/odd/configuration.xml). By default, TEI Publisher 9.1 - imports the dedicated modules/odd-global.xqm. - To update follow the generic instructions above. + imports the dedicated modules/odd-global.xqm. + To preserve backwards compatibility with apps generated by TEI Publisher 9.0, + tei-publisher-lib 4.0.1 will still import the entire config.xqm if no other module is + configured to be imported. However, to avoid unnecessary overhead, we strongly recommend to + switch to an explicit import as described below. + To update follow the generic instructions above and register the dedicated configuration + module: If your ODD was using $global anywhere, copy modules/odd-global.xqm from TEI Publisher 9.1 into the corresponding location of your app. Open the