clang:lexer( $variant as xs:string, [$normalization as xs:string?], [$args as item()*], [$library as xs:string] ) as element(lang:lexer)
This function constructs a custom lexer configuration item, suitable for use with clang:user-language-plugin.
clang:lexer
and when passing a lexer to
clang:user-language-plugin
then the value in the lexer takes precedence over the value in the
plugin configuration.
For a built-in lexer, specify an empty string for the library name,
or omit the library
parameter and specify an empty string in
clang:user-language-plugin
.
For a user-defined plugin, the library name should be of the form
plugin_path/plugin_id
, such as "native/sample_plugin".
If you omit this parameter, then the library
value from
clang:user-language-plugin
will be used.
(: Create a lexer config item from a user-defined plugin. :) xquery version "1.0-ml"; import module namespace clang = "http://marklogic.com/xdmp/custom-language" at "/MarkLogic/custom-language.xqy"; clang:lexer("special_lexer", "NFD", (), "native/sample_plugin")
(: Create a lexer config item from a built-in plugin (atilika), : and pass in some configuration options. :) xquery version "1.0-ml"; import module namespace clang = "http://marklogic.com/xdmp/custom-language" at "/MarkLogic/custom-language.xqy"; clang:lexer("atilika", (), ("normal-mode"), "")