Loading TOC...

xdmp:castable-as

xdmp:castable-as(
   $namespace-uri as xs:string,
   $local-name as xs:string,
   $item as item()?
) as xs:boolean

Summary

Returns true if a value is castable. This is similar to the "castable as" XQuery predicate, except that the type is determined at runtime.

Parameters
$namespace-uri The namespace URI of the type.
$local-name The local-name of the type.
$item The item to be cast.

Example

xdmp:castable-as(
    "http://www.w3.org/2001/XMLSchema",
    "integer",
    "12")
=> true()

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.