title: How to check an empty date argument in a XQuery function?
body: <p>Consider the following code which checks for an empty date:</p>
  
  <pre><code>declare xqse function tns:isEmptyDate($dob as xs:date) as xs:boolean {
      if(empty($dob)) then {
      }
  }
  </code></pre>
  
  <p>When executed, why do I get the below error in ALDSP:</p>
  
  <blockquote>
    <p><code>weblogic.xml.query.exceptions.XQueryDynamicException: {err}XP0021: "": can not cast to {http://www.w3.org/2001/XMLSchema}date: error: date: Invalid date value: wrong type:</code></p>
  </blockquote>