Returns true if the element node has the xsi:nil attribute set to true.
Built-in, C++, C#, Java, XQuery, XSLT 1.0, XSLT 2.0, XSLT 3.0.
Mandatory parameter. Must be connected to the source node that is to be checked.
The mapping design illustrated below copies data from a source to a target XML file conditionally, and also illustrates the usage of several functions, including is-xsi-nil. This mapping is called HandlingXsiNil.mfd and can be found in the <Documents>\Altova\MapForce2022\MapForceExamples\ directory.
As illustrated above, the is-xsi-nil function checks whether the xsi:nil attribute is "true" for the state item in the source file. If this attribute is "false", the filter will copy the parent Address element to the target. The source XML file looks as follows (excluding the XML and namespace declarations):
The result of the mapping is that no Address is copied to the target at all, because there is only one Address in the source, and the xsi:nil attribute is set to "true" for the state element. Consequently, the mapping output is as follows: