Checking whether the value of an input element exists, or is null
You can use the fn:exists
XPath function, and the
fn:nilled
XPath function to define conditional expressions that determine whether
an input element is present, or is null.
About this task
You can define conditional expressions in a transform to determine whether the transform should be applied or not in your message map.
For example, you might decide not to apply a transform if the input value is null.
You can use the following XPath functions
to define conditional expressions in a transform:
- Use the
fn:nilled
XPath function to test whether the value of an input element has thexsi:nil
attribute set. - Use the
fn:exists
XPath function to test whether the value of an input element is present.Note: An XML element that has thexsi:nil
attribute set is considered to be present.
Procedure
Take the following steps to define a conditional expression in a Move transform that determines whether the transform is applied or not. The transform applies if the element exists, and is not null.