Package dev.metaschema.core.metapath.function.library


package dev.metaschema.core.metapath.function.library
Built-in Metapath function implementations based on the XPath 3.1 specification.

This package provides concrete implementations of standard XPath 3.1 functions adapted to work with the Metaschema document model. Functions that operate on an XML document model (XDM) in XPath have been adapted to work with the Metaschema module-based model instead.

Function Categories

  • String Functions: fn:string, fn:concat, fn:contains, fn:starts-with, fn:ends-with, fn:substring, fn:normalize-space, fn:upper-case, fn:lower-case, fn:tokenize
  • Numeric Functions: fn:abs, fn:ceiling, fn:floor, fn:round
  • Sequence Functions: fn:count, fn:empty, fn:exists, fn:head, fn:tail, fn:reverse, fn:distinct-values, fn:index-of, fn:insert-before, fn:remove
  • Date/Time Functions: fn:current-date, fn:current-time, fn:current-dateTime, fn:year-from-date, fn:month-from-date, fn:day-from-date, and related component extraction functions
  • Boolean Functions: fn:boolean, fn:true, fn:false, fn:not
  • Array Functions: array:size, array:get, array:head, array:tail, array:reverse, array:flatten, array:join
  • Map Functions: map:contains, map:get, map:keys, map:put, map:remove, map:merge
  • Document Functions: fn:doc, fn:doc-available, fn:base-uri, fn:document-uri

Metaschema-Specific Extensions

This package also includes Metapath-specific functions not present in XPath 3.1:

Function Registration

All built-in functions are registered in DefaultFunctionLibrary, which is loaded via the Java ServiceLoader mechanism.

See Also: