The simplest way of explaining fn:nilled() is that it
returns true if two conditions are satisfied:
(a) the element specifies
(b) the element is validated against a
To be honest, I don't know of any practical use case for
this function. I think that the "nilled" property was needed in the data model
to make the formal semantics work, and having got the property in the data
model, people felt it ought to be accessible to applications. If you find a good
use for it, let me know, because I can't think of one!
Generally xsi:nil is a bit of a disaster anyway. I don't see why you
can't represent absent data by omitting the element, rather than having it
present with no value.
I've been trying to use the nilled
function but it seems like I am missing something about it. I'd appreciate if
you could take a look at the attached example and find out why it doesn't work
Note that there ain't a schema (with
nillable=true) attached to the source, as in the actual case (ain't an option)
upon which the example is based.
I am currently using 22.214.171.124, which is
embedded with the runtime in question.