Loading TOC...

fn:nilled

fn:nilled(
   $arg as node()?
) as xs:boolean?

Summary

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().

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".

Parameters
arg The node to test for nilled status.

Example

fn:nilled(<foo/>)
=> false

fn:nilled(<foo xsi:nil="true"/>)
=> true, if the schema for foo allows nillable

fn:nilled(<foo xsi:nil="false"/>)
=> false

fn:nilled(())
=> ()

fn:nilled(text { "foo" })
=> ()

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