<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.castableAs.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.castableAs</api:function-name><api:suggest>xdmp.castableas</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>castableas</api:suggest><api:function-link mode="xquery" fullname="xdmp:castable-as">/apidoc/8.0/xdmp:castable-as.xml</api:function-link><api:function mode="javascript" name="castableAs" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.castableAs"><api: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.
</api:summary><api:params><api:param name="namespace-uri" type="xs:string"><api:param-description>
    The namespace URI of the type.
  </api:param-description><api:param-name>namespace-uri</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="local-name" type="xs:string"><api:param-description>
    The local-name of the type.
  </api:param-description><api:param-name>local-name</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="item" type="item()?"><api:param-description>
    The item to be cast.
  </api:param-description><api:param-name>item</api:param-name><api:param-type>String?</api:param-type></api:param></api:params><api:return>Boolean</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.castableAs(
    "http://www.w3.org/2001/XMLSchema",
    "integer",
    "12")
=&gt; true()
</pre>
</api:example></api:function></api:function-page>