Search code examples
marklogic

MarkLogic TDE doesn't support xdmp:uri-content-type or xdmp:uri-format as transformation functions?


I am a little surprised that xdmp:uri-content-type and xdmp:uri-format are not supported as transformation functions in MarkLogic TDE (template-driven extraction) template.

[javascript] TDE-EVALFAILED: tde.nodeDataExtract(...) -- Eval for $doc-format='xdmp:uri-content-type($doc-uri)' returns XDMP-UNDFUN: (err:XPST0017) Undefined function xdmp:uri-content-type()

Indeed the two are not listed as acceptable functions in the documentation: https://docs.marklogic.com/10.0/guide/app-dev/TDE#id_99178

Just want to confirm if it is the case and also I am curious about the rationale.


Solution

  • These functions require access to mimetype settings inside MarkLogic configuration, which is probably the reason why they are unavailable. To get something similar to format based on a node or document at hand, use xdmp:node-kind instead. Content-type will need to be calculated upfront unfortunately, during ingest.

    HTH!