The simplest way of explaining fn:nilled() is that it returns true if two conditions are satisfied:
 
 (a) the element specifies xsi:nil="true"
 
 (b) the element is validated against a schema
 
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.
 
Michael Kay
http://www.saxonica.com/


From: Fernando Ribeiro [mailto:webmaster@fernandoribeiro.eti.br]
Sent: 29 January 2009 16:57
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: [saxon] Use of fn:nilled

All,
 
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 as expected.
 
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.
 
The only reference I could find for problems with nilled is http://sourceforge.net/tracker2/?func=detail&aid=1717100&group_id=29872&atid=397617, but it is already closed.
 
I am currently using 8.9.0.4, which is embedded with the runtime in question.
 
Thanks,
 
Fernando