<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.nilled.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.nilled</api:function-name><api:suggest>fn.nilled</api:suggest><api:suggest>fn</api:suggest><api:suggest>nilled</api:suggest><api:function-link mode="xquery" fullname="fn:nilled">/apidoc/8.0/fn:nilled.xml</api:function-link><api:function mode="javascript" name="nilled" type="builtin" lib="fn" category="AccessorBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.nilled"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">
Summary: Returns an xs:boolean indicating whether the argument node is
"nilled". If the argument is not an element node, returns the empty sequence.
If the argument is the empty sequence, returns the empty sequence.
For element nodes, true() is returned
if the element is nilled, otherwise false().</p>
<p xmlns="http://www.w3.org/1999/xhtml">
Elements may be defined in a schema as nillable, which allows an empty
instance of an element to a appear in a document even though its type
requires that it always have some content.  Nilled elements should always be
empty but an element is not considered nilled just because it's empty.
It must also have the type annotation attribute xsi:nil="true".
</p>
</api:summary><api:params><api:param name="arg" type="node()?"><api:param-description>
The node to test for nilled status.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>Node?</api:param-type></api:param></api:params><api:return>Boolean?</api:return><api:usage>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.nilled(xdmp.unquote('&lt;foo/&gt;').toArray()[0].xpath("/foo"));
=&gt; false

var node = xdmp.unquote(
  '&lt;foo xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/&gt;')
    .toArray()[0].xpath("/foo")
fn.nilled(node);

=&gt; true, if the schema for foo allows nillable

var node = xdmp.unquote(
 '&lt;foo xsi:nil="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/&gt;')
    .toArray()[0].xpath("/foo")
fn.nilled(node);

=&gt; false

fn.nilled(null)
=&gt; ()

var node = new NodeBuilder();
node.addText("text node");
node.toNode();
fn.nilled(node);

=&gt; ()
</pre></api:example></api:function></api:function-page>